diff options
author | Arnaud Desmons <adesmons@mandriva.com> | 2002-09-03 13:28:28 +0000 |
---|---|---|
committer | Arnaud Desmons <adesmons@mandriva.com> | 2002-09-03 13:28:28 +0000 |
commit | 2a0c44a89ff2ebd4e3de5fa7e3cfc82c23706eff (patch) | |
tree | 48996e6f444a404d4b9c7ed51e371024469af2df /proxy_wizard/scripts | |
parent | 62086547910b4f73ae63c8c349a20f2718426e2f (diff) | |
download | drakwizard-2a0c44a89ff2ebd4e3de5fa7e3cfc82c23706eff.tar drakwizard-2a0c44a89ff2ebd4e3de5fa7e3cfc82c23706eff.tar.gz drakwizard-2a0c44a89ff2ebd4e3de5fa7e3cfc82c23706eff.tar.bz2 drakwizard-2a0c44a89ff2ebd4e3de5fa7e3cfc82c23706eff.tar.xz drakwizard-2a0c44a89ff2ebd4e3de5fa7e3cfc82c23706eff.zip |
some fillfunc
Diffstat (limited to 'proxy_wizard/scripts')
-rw-r--r-- | proxy_wizard/scripts/Squidconf.pm | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/proxy_wizard/scripts/Squidconf.pm b/proxy_wizard/scripts/Squidconf.pm index 4437e355..d9d1c103 100644 --- a/proxy_wizard/scripts/Squidconf.pm +++ b/proxy_wizard/scripts/Squidconf.pm @@ -3,10 +3,38 @@ package Squidconf; require "__WIZ_HOME__/common/scripts/Vareqval.pm"; require "__WIZ_HOME__/common/scripts/Varspaceval.pm"; +require "__WIZ_HOME__/common/scripts/DrakconnectConf.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"); + "$1.$2.$3.0/$mask" if $wiz_ip_server =~ /(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/; +} + +sub testport { + if ($ENV{wiz_squid_port} == 3128 || $ENV{wiz_squid_port} == 8080) { + return 0; + } + elsif ($ENV{wiz_squid_port} <= 1024 || $ENV{wiz_squid_port} >= 65536) { + return 2; + } + 1; +} + +sub port { + my $ret; + my @lines = grep(/$ENV{wiz_squid_port}\/tcp/, cat_("/etc/services")); + foreach (@lines) { + s/\t/ /g; + $ret .= "\n$_"; + } + $ret; +} + sub do_it_squid { my $file="/etc/squid/squid.conf"; -f $file and MDK::Common::cp_af($file, $file.".orig"); |