From 0c24f86ef88df61f17770a60376ab934101e6677 Mon Sep 17 00:00:00 2001 From: Florent Villard Date: Sun, 2 Mar 2003 14:12:24 +0000 Subject: use services.pm to restart smb in samba wizard --- proxy_wizard/scripts/Squidconf.pm | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'proxy_wizard') 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; -- cgit v1.2.1