From cc812497f536d469ba7fe0322c20396ea103e6bb Mon Sep 17 00:00:00 2001 From: Guillaume Cottenceau Date: Thu, 7 Mar 2002 13:10:06 +0000 Subject: - call net_monitor to disable internet connection before network-restart - user return value when status'ing the initscripts rather than grepping their text output --- perl-install/standalone/drakgw | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) (limited to 'perl-install') diff --git a/perl-install/standalone/drakgw b/perl-install/standalone/drakgw index 9de8ea10c..5252ef10d 100755 --- a/perl-install/standalone/drakgw +++ b/perl-install/standalone/drakgw @@ -78,14 +78,23 @@ sub start_daemons () my $cups_used = 0; standalone::explanations("Starting daemons"); if (-f "/etc/rc.d/init.d/cups") { - if (grep(/is running/, `/etc/rc.d/init.d/cups status`)) { + if (system("/etc/rc.d/init.d/cups status >/dev/null") == 0) { $cups_used = 1; sys("/etc/rc.d/init.d/cups stop"); } } - grep(/is running/, `/etc/rc.d/init.d/dhcpd status 2> /dev/null`) and sys("/etc/rc.d/init.d/dhcpd stop"); - grep(/connection refused/, `/etc/rc.d/init.d/named status 2> /dev/null`) or sys("/etc/rc.d/init.d/named stop"); + system("/etc/rc.d/init.d/dhcpd status >/dev/null") == 0 and sys("/etc/rc.d/init.d/dhcpd stop"); + system("/etc/rc.d/init.d/named status >/dev/null 2>/dev/null") == 0 and sys("/etc/rc.d/init.d/named stop"); + + my $netmon = '/usr/sbin/net_monitor'; + my $netmon_need_start; + if (-x $netmon && `$netmon --status` eq 1) { + $netmon_need_start = 1; + system("$netmon --disconnect --force --quiet >/dev/null"); + } sys("/etc/rc.d/init.d/network restart"); + $netmon_need_start and system("$netmon --connect --force --quiet >/dev/null"); + sys("sh $rc_firewall_generic"); sys("/etc/rc.d/init.d/$_ start"), sys("/sbin/chkconfig --level 345 $_ on") foreach 'named', 'dhcpd'; @@ -97,8 +106,8 @@ sub start_daemons () sub stop_daemons () { standalone::explanations("Stopping daemons"); - grep /is running/, `/etc/rc.d/init.d/dhcpd status` and sys("/etc/rc.d/init.d/dhcpd stop"); - grep /Connection refused/, `/etc/rc.d/init.d/named status 2>&1` or sys("/etc/rc.d/init.d/named stop"); + system("/etc/rc.d/init.d/dhcpd status >/dev/null") == 0 and sys("/etc/rc.d/init.d/dhcpd stop"); + system("/etc/rc.d/init.d/named status >/dev/null 2>/dev/null") == 0 and sys("/etc/rc.d/init.d/named stop"); if ($kernel_version eq "2.2") { sys("/sbin/ipchains -F"); } else { @@ -725,6 +734,13 @@ Click on Configure to launch the setup wizard.", $setup_state)); #------------------------------------------------- #- $Log$ +#- Revision 1.60 2002/03/07 13:10:06 gc +#- - call net_monitor to disable internet +#- connection before network-restart +#- - user return value when status'ing the +#- initscripts rather than grepping their +#- text output +#- #- Revision 1.59 2002/02/22 18:58:22 gc #- exit the pur_gtk version after launching the wizard version #- -- cgit v1.2.1