From 306951e28791b261f894a8b71255b4c45d105661 Mon Sep 17 00:00:00 2001 From: Florent Villard Date: Mon, 20 Oct 2003 10:51:59 +0000 Subject: change copyright remove old xml related files --- news_wizard/scripts/Newsconf.pm | 77 ----------------------------------------- 1 file changed, 77 deletions(-) delete mode 100644 news_wizard/scripts/Newsconf.pm (limited to 'news_wizard/scripts') diff --git a/news_wizard/scripts/Newsconf.pm b/news_wizard/scripts/Newsconf.pm deleted file mode 100644 index 10b6bfa6..00000000 --- a/news_wizard/scripts/Newsconf.pm +++ /dev/null @@ -1,77 +0,0 @@ -#!/usr/bin/perl - -# Drakwizard - -# Copyright (C) 2002 MandrakeSoft Arnaud Desmons -# -# 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 Newsconf; -require "__WIZ_HOME__/common/scripts/Vareqval.pm"; -use MDK::Common; -use strict; - -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 = Vareqval->get("/etc/leafnode/config"); - $mdk{server}; -} - -sub normalize_server { - my ($server) = @_; - - $server; -} - -sub do_it { - $ENV{wiz_news_freq} and my $freq = normalize_freq($ENV{wiz_news_freq}) or - die "freq not defined: $!"; - $ENV{wiz_news_server} and my $server = normalize_server($ENV{wiz_news_server}) or - die "server not defined: $!"; - my $file = "/etc/leafnode/config"; - 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"); - 10; -} - -1; -- cgit v1.2.1