From 8f5aea5c59228ff4e71ba8951313d59fbfd99723 Mon Sep 17 00:00:00 2001 From: Arnaud Desmons Date: Mon, 9 Dec 2002 17:24:23 +0000 Subject: No more use of drakconnect_conf, use of IFCFG.pm instead of DrakconnectConf.pm --- proxy_wizard/scripts/Squidconf.pm | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) (limited to 'proxy_wizard/scripts') diff --git a/proxy_wizard/scripts/Squidconf.pm b/proxy_wizard/scripts/Squidconf.pm index 3c343b8f..528d3ab4 100644 --- a/proxy_wizard/scripts/Squidconf.pm +++ b/proxy_wizard/scripts/Squidconf.pm @@ -1,17 +1,36 @@ #!/usr/bin/perl +# Drakwizard + +# Copyright (C) 2002 MandrakeSoft Arnaud Desmons (adesmons@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 Squidconf; require "__WIZ_HOME__/common/scripts/Vareqval.pm"; require "__WIZ_HOME__/common/scripts/Varspaceval.pm"; -require "__WIZ_HOME__/common/scripts/DrakconnectConf.pm"; +require "__WIZ_HOME__/common/scripts/IFCFG.pm"; use MDK::Common; use strict; use standalone; sub network_mask { - my $o = DrakconnectConf->new(); - my $wiz_ip_server = $o->get_from_known_dev("IP"); - my $mask = $o->get_from_known_dev("Mask"); + my $o = IFCFG->new(); + my $wiz_ip_server = $o->itf_get("IPADDR"); + my $mask = $o->itf_get("NETMASK"); "$1.$2.$3.0/$mask" if $wiz_ip_server =~ /(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/; } @@ -39,7 +58,6 @@ sub do_it_squid { my $file="/etc/squid/squid.conf"; -f $file and MDK::Common::cp_af($file, $file.".orig"); MDK::Common::cp_af("__WIZ_HOME__/proxy_wizard/scripts/squid.conf.default", $file); - print "$ENV{wiz_squid_defdir}\n"; substInFile { s|^\s*\#?\s*(cache_dir.*$ENV{wiz_squid_defdir}\s*)\d*(.*)|$1$ENV{wiz_squid_disk}$2|; s|^\s*\#?\s*(acl\s*mynetwork\s*src\s*).*$|$1$ENV{wiz_squid_mynetw}\n|; @@ -49,7 +67,6 @@ sub do_it_squid { standalone::explanations("$file: cache_dir = $ENV{wiz_squid_defdir} $ENV{wiz_squid_disk} mynetw = $ENV{wiz_squid_mynetw} cache_mem = $ENV{wiz_squid_mem} http_port = $ENV{wiz_squid_port} level = $ENV{wiz_squid_level}"); - print "$ENV{wiz_squid_level}\n"; if ($ENV{wiz_squid_level} == 1) { substInFile { s|^\s*\#?\s*(http_access\s*)deny(\s*all.*)|\#$&\n$1allow$2|; -- cgit v1.2.1