summaryrefslogtreecommitdiffstats
path: root/news_wizard
diff options
context:
space:
mode:
Diffstat (limited to 'news_wizard')
-rw-r--r--news_wizard/.perl_checker1
-rwxr-xr-xnews_wizard/Inn.pm160
-rw-r--r--news_wizard/Makefile29
-rwxr-xr-xnews_wizard/scripts/check_news_server.sh48
-rwxr-xr-xnews_wizard/scripts/check_valid_hours.sh49
-rw-r--r--news_wizard/scripts/config.default116
-rwxr-xr-xnews_wizard/scripts/do_it_news.sh86
-rw-r--r--news_wizard/scripts/news.cron10
8 files changed, 0 insertions, 499 deletions
diff --git a/news_wizard/.perl_checker b/news_wizard/.perl_checker
deleted file mode 100644
index 725f44b4..00000000
--- a/news_wizard/.perl_checker
+++ /dev/null
@@ -1 +0,0 @@
-Basedir .. \ No newline at end of file
diff --git a/news_wizard/Inn.pm b/news_wizard/Inn.pm
deleted file mode 100755
index 0cd3e06f..00000000
--- a/news_wizard/Inn.pm
+++ /dev/null
@@ -1,160 +0,0 @@
-#!/usr/bin/perl
-
-# Drakwizard
-
-# Copyright (C) 2003 Mandrakesoft
-#
-# Author: Florent Villard <warly@mandrakesoft.com>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-package MDK::Wizard::Inn;
-use strict;
-
-use common;
-require MDK::Wizard::Wizcommon;
-use MDK::Wizard::Varspaceval;
-
-my $wiz = new MDK::Wizard::Wizcommon;
-
-my $o = {
- name => N("News Wizard"),
- var => {
- news_server => '',
- news_freq => ''
- },
- needed_rpm => [ 'inn' ],
- defaultimage => "$ENV{__WIZ_HOME__}news_wizard/images/news.png"
- };
-
-$o->{pages} = {
- welcome => {
- name => N("Welcome to the News Wizard") . "\n\n" . N("This wizard will help you configuring the Internet News services for your network."),
- no_back => 1,
- next => 'ask_news_server'
- },
- ask_news_server => {
- name => N("News server") . "\n\n" . N("The news server name is the name of the host providing the Internet news to your network; the name is usually provided by your provider.") . "\n\n" . N("Internet host names must be in the form \"host.domain.domaintype\"; for example, if your provider is \"provider.com\", the Internet news server is usually \"news.provider.com\"."),
- pre => sub {
- $o->{var}{news_server} ||= get_server();
- },
- data => [
- { label => N("News server name:"), val => \$o->{var}{news_server} },
- ],
- post => sub { $o->{var}{news_server} || 'error_in_news_server' },
- next => 'ask_news_freq'
- },
- ask_news_freq => {
- name => N("Polling period") . "\n\n" . N("Your server will regularly poll the News server to obtain the latest Internet News; the polling period sets the interval between two consecutive attempts.") . "\n\n" . N("Depending on the kind of Internet connection you have, an appropriate polling period can change between 6 and 24 hours."),
- pre => sub {
- $o->{var}{news_freq} ||= 24;
- },
- data => [
- { label => N("Polling period (hours):"), val => \$o->{var}{news_freq} },
- ],
- post => \&check_valid_hours,
- next => 'summary'
- },
- warning => {
- name => N("Warning."),
- ignore => 1,
- next => 'summary'
- },
- error_in_news_server => {
- name => N("Error.") . "\n\n" . N("The news server name is not correct"),
- ignore => 1,
- next => 'ask_news_server'
- },
- error_in_polling_time => {
- name => N("Error.") . "\n\n" . N("The polling period is not correct"),
- ignore => 1,
- next => 'ask_news_freq'
- },
- summary => {
- name => N("Configuring the Internet News") . "\n\n" . N("The wizard collected the following parameters needed to configure your Internet News service:") . "\n\n" . N("To accept these values, and configure your server, click the next button or use the back button to correct them."),
- data => [
- { label => N("News server:"), val_ref => \$o->{var}{news_server} },
- { label => N("Polling interval:"), val_ref => \$o->{var}{news_freq} },
- ],
- post => \&do_it,
- next => 'end'
- },
- end => {
- name => N("Congratulations") . "\n\n" . N("The wizard successfully configured your Internet News service of your server."),
- end => 1,
- next => 0
- },
-};
-
-sub new {
- my ($class) = @_;
- bless $o, $class;
-}
-
-sub check_valid_hours {
- $o->{var}{news_freq} =~ /^\d+$/ or return 'error_in_polling_time'
-}
-
-sub normalize_freq {
- my ($freq) = @_;
-
- if ($freq =~ /(\d*)/) {
- $freq = $1;
- }
- if ($freq <= 0) {
- $freq = 0;
- }
- if ($freq >= 24) {
- $freq = 24;
- }
- $freq;
-}
-
-sub get_server {
- my %mdk = MDK::Wizard::Varspaceval->get("/etc/leafnode/config");
- $mdk{server}
-}
-
-sub normalize_server {
- my ($server) = @_;
- $server
-}
-
-sub do_it {
- $::testing and return;
- $o->{var}{news_freq} and my $freq = normalize_freq($o->{var}{news_freq}) or
- die "freq not defined: $!";
- $o->{var}{news_server} and my $server = normalize_server($o->{var}{news_server}) or
- die "server not defined: $!";
- my $file = "/etc/leafnode/config";
- -d "/etc/leafnode" or mkdir "/etc/leafnode";
- output($file, map {
- s|__server__|$server|g;
- $_;
- } cat_("__WIZ_HOME__/news_wizard/scripts/config.default"));
- $file = "/var/spool/cron/news";
- my $file_c = "/etc/leafnode/crontab";
- if (-f $file) {
- MDK::Common::cp_af($file, $file_c);
- MDK::Common::cp_af($file, $file . ".orig");
- }
- output($file_c, map {
- s|__freq__|$freq|g;
- $_;
- } cat_("__WIZ_HOME__/news_wizard/scripts/news.cron"));
- system("crontab -u news /etc/leafnode/crontab");
-}
-
-1;
diff --git a/news_wizard/Makefile b/news_wizard/Makefile
deleted file mode 100644
index 27ec47ef..00000000
--- a/news_wizard/Makefile
+++ /dev/null
@@ -1,29 +0,0 @@
-install2:
- su -c 'make install'
-
-install:
- mkdir -p --mode=u=rwx,g=rx,o=rx ${prefix}/share/wizards
- mkdir -p --mode=u=rwx,g=rx,o=rx ${prefix}/share/wizards/news_wizard
- mkdir -p --mode=u=rwx,g=rx,o=rx ${prefix}/share/wizards/news_wizard/scripts
- mkdir -p --mode=u=rwx,g=rx,o=rx ${prefix}/share/wizards/news_wizard/images
- install --mode=u=rw,g=r,o=r -p news.wiz ${prefix}/share/wizards/news_wizard
-
-
-
-
-
- install --mode=a=r -p ./images/news.png ${prefix}/share/wizards/news_wizard/images
- install --mode=u=rwx,g=rx,o=rx -p scripts/*.sh ${prefix}/share/wizards/news_wizard/scripts
- install --mode=u=rw,g=r,o=r -p scripts/Newsconf.pm ${prefix}/share/wizards/news_wizard/scripts
- find scripts -name "*.default" -exec cp '{}' ${prefix}/share/wizards/news_wizard/scripts \;
- find scripts -name "*.patch" -exec cp '{}' ${prefix}/share/wizards/news_wizard/scripts \;
- find scripts -name "*.cron" -exec cp '{}' ${prefix}/share/wizards/news_wizard/scripts \;
-
-
-run:
- (su -c "make install; unset WIZPATH; export DEBUG_WIZ='/dev/pts/0'; wiz /usr/share/wizards/news_wizard/news.wiz")
-
-desktop:
- cp -f desktop_data/news_wizard\ wiz ${HOME}/Desktop
- cp -f desktop_data/util1.gif ${HOME}/.kde/share/icons/
-
diff --git a/news_wizard/scripts/check_news_server.sh b/news_wizard/scripts/check_news_server.sh
deleted file mode 100755
index f1eee021..00000000
--- a/news_wizard/scripts/check_news_server.sh
+++ /dev/null
@@ -1,48 +0,0 @@
-#!/bin/bash
-#
-# Wizard
-#
-# Copyright (C) 2000 Mandrakesoft.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-# See file LICENSE for further informations on licensing terms.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-# Authors: Jerome Dumonteil, Maurizio De Cecco, Enzo Maggi
-# icons: Helene Durosini <ln@mandrakesoft.com>
-# <corporate@mandrakesoft.com> http://www.mandrakesoft.com
-
-# script for wizard leafnode configuration
-#
-# checking if the provided server is correct :
-# strip the @ and illegal characters
-
-
-if [ -z "${wiz_news_server}" ] ;then
- echo_debug "wiz_news_server is empty, should not."
- exit 1
-fi
-
-
-test=`echo ${wiz_news_server##*@} |sed -e 's/[^0-9a-zA-Z-\.]//g'`
-
-if [ -z "${test}" ] ;then
- echo_debug "wiz_news_server is empty, should not."
- exit 1
-fi
-
-
-# all seems to be ok
-exit 10
-
diff --git a/news_wizard/scripts/check_valid_hours.sh b/news_wizard/scripts/check_valid_hours.sh
deleted file mode 100755
index ea30c0bd..00000000
--- a/news_wizard/scripts/check_valid_hours.sh
+++ /dev/null
@@ -1,49 +0,0 @@
-#!/bin/bash
-#
-# Wizard
-#
-# Copyright (C) 2000 Mandrakesoft.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-# See file LICENSE for further informations on licensing terms.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-# Authors: Jerome Dumonteil, Maurizio De Cecco, Enzo Maggi
-# icons: Helene Durosini <ln@mandrakesoft.com>
-# <corporate@mandrakesoft.com> http://www.mandrakesoft.com
-
-# script for wizard leafnode configuration
-#
-# checking if the provided hours are correct :
-# from 1 to 24
-
-
-if [ -z "${wiz_news_freq}" ] ;then
- echo_debug "wiz_news_freq is empty, should not."
- exit 1
-fi
-
-typeset -i test
-
-test=`echo ${wiz_news_freq} |sed -e 's/[^0-9]//g'`
-
-if [ -z "${test}" ] ;then
- echo_debug "wiz_news_freq is empty, should not."
- exit 1
-fi
-
-
-# all seems to be ok
-exit 10
-
diff --git a/news_wizard/scripts/config.default b/news_wizard/scripts/config.default
deleted file mode 100644
index c1c98a3d..00000000
--- a/news_wizard/scripts/config.default
+++ /dev/null
@@ -1,116 +0,0 @@
-## This is the NNTP server leafnode fetches its news from.
-## You need read and post access to it. Mandatory.
-server = __server__
-
-## Unread discussion threads will be deleted after this many days if
-## you don't define special expire times. Mandatory.
-expire = 14
-
-##
-## All the following parameters are optional
-##
-
-## I have free access to my news server. If you don't have, comment out
-## the following two lines and change them accordingly.
-# username = gulbrandsen
-# password = secret
-
-## Standard news servers run on port 119. If your newsserver doesn't, comment
-## out the following line and change it accordingly.
-# port = 8000
-
-## This is another news server which stores some groups that are not
-## available on the first one. You can define username, password and port
-## for each server separately.
-# server = sex.and.warez.com
-# username = xenu
-# password = secret
-
-## This is a news server which does not understand the
-## "LIST NEWSGROUP news.group" command. For this reason, we don't try to
-## download newsgroups descriptions when getting new newsgroups. This is
-## achieved by putting "nodesc = 1" somewhere behind the server
-## line.
-# server = broken.upstream.server
-# nodesc = 1
-
-## Here we have another news server which has a very slow connection. For
-## that reason, we wait a full minute before we give up trying to connect.
-## The default is 10 seconds.
-# server = really.slow.snail
-# timeout = 60
-
-## Non-standard expire times (glob(7) wildcard constructs possible)
-# groupexpire comp.os.linux.* = 5 # groups too big to hold articles 20 days
-# groupexpire any.local.newsgroup = 100 # very interesting, hold articles longer
-
-## Never fetch more than this many articles from one group in one run.
-## Be careful with this; setting it much below 1000 is probably a bad
-## idea.
-maxfetch = 2000
-
-## Fetch only a few articles when we subscribe a new newsgroup. The
-## default is to fetch all articles.
-initialfetch = 1000
-
-## If you want to use leafnode like an offline newsreader (e.g. Forte
-## Agent) you can download headers and bodies separately if you set
-## delaybody to 1. In this case, fetch will only download the headers
-## and only when you select an article, it will download the body.
-## This can save a huge amount of bandwith if only few articles are really
-## read from groups with lots of postings.
-## This feature works not very well with Netscape, though (which is not
-## a fault of Leafnode).
-# delaybody = 0
-
-## To avoid spam, you can select the maximum number of crosspostings
-## that are allowed in incoming postings. Setting this below 5 is
-## probably a bad idea. The default is unlimited crossposting.
-maxcrosspost = 8
-
-## If you suffer from repeatedly receiving old postings (this happens
-## sometimes when an upstream server goes into hiccup mode) you can
-## refuse to receive them with the parameter "maxage" which tells the
-## maximum allowed age of an article in days. The default maxage is 10
-## days.
-maxage = 7
-
-## maxlines will make fetch reject postings that are longer than a certain
-## amount of lines.
-maxlines = 500
-
-## minlines will make fetch reject postings that are shorter than a certain
-## amount of lines.
-minlines = 2
-
-## maxbytes will make fetch reject postings that are larger
-maxbytes = 50000
-
-## timeout_short determines how many days fetch gets a newsgroup which
-## has been accidentally opened. The default is two days.
-timeout_short = 2
-
-## timeout_long determines how many days fetch will wait before not getting
-## an unread newsgroup any more. The default is seven days.
-timeout_long = 7
-
-## timeout_active determines how many days fetch will wait before re-reading
-## the whole active file. The default is 90 days.
-# timeout_active = 365
-
-## If you want to have your newsreader score/kill on Xref: lines, you might
-## want to uncomment this.
-# create_all_links = 1
-
-## If you want to filter out certain regular expressions in the header,
-## create a "filterfile" (how this is done is explained in the README)
-## and set
-# filterfile = /path/to/your/filterfile
-
-## If your newsreader does not supply a Message-ID for your postings
-## Leafnode will supply one, using the hostname of the machine it is
-## running on. If this hostname is not suitable, this parameter can be
-## used to override it. Do not use a fantasy name, it may interfere with
-## the propagation of your messages. Most modern newsreaders do provide
-## a Message-ID.
-# hostname = host.domain.country
diff --git a/news_wizard/scripts/do_it_news.sh b/news_wizard/scripts/do_it_news.sh
deleted file mode 100755
index a67d0d99..00000000
--- a/news_wizard/scripts/do_it_news.sh
+++ /dev/null
@@ -1,86 +0,0 @@
-#!/bin/bash
-#
-# Wizard
-#
-# Copyright (C) 2000 Mandrakesoft.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-# See file LICENSE for further informations on licensing terms.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-# Authors: Jerome Dumonteil, Maurizio De Cecco, Enzo Maggi
-# icons: Helene Durosini <ln@mandrakesoft.com>
-# <corporate@mandrakesoft.com> http://www.mandrakesoft.com
-
-# script for wizard leafnode configuration
-#
-# put the default leafnode configuration
-# assuming all dependencies are ok
-
-
-# wiz_news_server and wiz_news_freq are provided by the running wizard
-
-# security
-typeset -i freq
-freq=`echo ${wiz_news_freq} |sed -e 's/[^0-9]//g'`
-
-if [ $freq -le 0 ]; then
- freq=1
-fi
-if [ $freq -ge 24 ]; then
- freq=24
-fi
-
-
-server=`echo ${wiz_news_server##*@} |sed -e 's/[^0-9a-zA-Z-\.]//g'`
-
-# store the wiz_news_server and wiz_news_freq value
-file=/etc/sysconfig/mdk_serv
-chg_val ${file} wiz_news_freq ${freq} s
-chg_val ${file} wiz_news_server ${server} s
-
-
-# leafnode configuration file
-config="/etc/leafnode/config"
-if [ ! -f ${config} ]; then
- echo_debug "no leafnode configuration file found ! exiting."
- exit 1
-fi
-
-bck_file ${config}
-
-cat ${CWD}/scripts/config.default \
-| sed -e 's/__server__/'"${server}"'/' > ${config}
-
-echo_debug "config file done, putting crontab for news"
-
-if [ -f /var/spool/cron/news ]; then
- cp -f /var/spool/cron/news /etc/leafnode/crontab
-fi
-
-bck_file /etc/leafnode/crontab
-
-cat ${CWD}/scripts/news.cron \
-| sed -e 's/__freq__/'"${freq}"'/' > /etc/leafnode/crontab
-
-
-echo_debug "installing news crontab"
-crontab -u news /etc/leafnode/crontab
-
-
-# all is ok
-exit 10
-
-
-
diff --git a/news_wizard/scripts/news.cron b/news_wizard/scripts/news.cron
deleted file mode 100644
index 5785bfb2..00000000
--- a/news_wizard/scripts/news.cron
+++ /dev/null
@@ -1,10 +0,0 @@
-### leafnode crontab
-SHELL=/bin/bash
-PATH=/bin:/sbin:/usr/bin:/usr/sbin
-MAILTO=root@localhost
-
-
-35 4 * * * /usr/sbin/texpire
-
-5 */__freq__ * * * /usr/sbin/fetchnews -v 2>&1
-