diff options
Diffstat (limited to 'proxy_wizard/scripts/Squidconf.pm')
-rw-r--r-- | proxy_wizard/scripts/Squidconf.pm | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/proxy_wizard/scripts/Squidconf.pm b/proxy_wizard/scripts/Squidconf.pm index 528d3ab4..0155a72f 100644 --- a/proxy_wizard/scripts/Squidconf.pm +++ b/proxy_wizard/scripts/Squidconf.pm @@ -20,10 +20,12 @@ package Squidconf; +use lib '/usr/lib/libDrakX'; require "__WIZ_HOME__/common/scripts/Vareqval.pm"; require "__WIZ_HOME__/common/scripts/Varspaceval.pm"; require "__WIZ_HOME__/common/scripts/IFCFG.pm"; use MDK::Common; +use services; use strict; use standalone; @@ -83,8 +85,7 @@ level = $ENV{wiz_squid_level}"); s|^\s*\#?\s*(http_access\s*)allow(\s*all.*)|\#$&\n$1deny$2|; s|^\s*\#?\s*(http_access\s*allow\s*)mynetwork|\#$&\n$1localhost|; } $file; - } - else { # should not happen + } else { # should not happen die "wiz_squid_level error"; } my $t = 0; @@ -108,7 +109,11 @@ level = $ENV{wiz_squid_level}"); append_to_file($file, "cache_peer $ENV{wiz_squid_cachepeer} parent $ENV{wiz_squid_peerport} 3130"); } system("/sbin/chkconfig --level 345 squid on"); - system("service squid start"); + if (services::is_service_running('squid')) { + services::restart('squid') + } else { + services::start('squid') + } 10; } 1; |