summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.org>2004-07-19 07:45:48 +0000
committerOlivier Blin <oblin@mandriva.org>2004-07-19 07:45:48 +0000
commitdea649afc27976e6e5951f90672cc7e2dc1b4e2d (patch)
treeec5a513b796dce0d3543db692ebcfd895b51ec5a
parent2e422da03c6491bbf21ff683c22cc9ec4a42e851 (diff)
downloaddrakx-dea649afc27976e6e5951f90672cc7e2dc1b4e2d.tar
drakx-dea649afc27976e6e5951f90672cc7e2dc1b4e2d.tar.gz
drakx-dea649afc27976e6e5951f90672cc7e2dc1b4e2d.tar.bz2
drakx-dea649afc27976e6e5951f90672cc7e2dc1b4e2d.tar.xz
drakx-dea649afc27976e6e5951f90672cc7e2dc1b4e2d.zip
use run_program, try to handle default interface better
-rwxr-xr-xperl-install/standalone/net_monitor9
1 files changed, 5 insertions, 4 deletions
diff --git a/perl-install/standalone/net_monitor b/perl-install/standalone/net_monitor
index 9c8c10852..b001235d2 100755
--- a/perl-install/standalone/net_monitor
+++ b/perl-install/standalone/net_monitor
@@ -149,15 +149,16 @@ my $during_connection;
my $first;
sub bg_command_as_root {
- fork() or exec { 'consolehelper' } @_ or die N("consolehelper missing");
+ my $name = shift;
+ run_program::raw({ detach => 1 }, [ 'consolehelper', $name ], @_);
}
sub start_connection() {
- bg_command_as_root('/sbin/ifup', $default_intf);
+ $default_intf and bg_command_as_root('/sbin/ifup', $default_intf);
}
sub stop_connection() {
- bg_command_as_root('/sbin/ifdown', $default_intf);
+ $default_intf and bg_command_as_root('/sbin/ifdown', $default_intf);
}
sub connection() {
@@ -448,7 +449,7 @@ sub update() {
$statusbar->push(1, $isconnected == 1 ? N("Connected") : N("Not connected"));
}
$button_connect->set("label", $isconnected == 1 ? N("Disconnect %s", $netcnx->{type}) : N("Connect %s", $netcnx->{type}));
- $button_connect->set_sensitive(scalar(@interfaces));
+ $button_connect->set_sensitive($default_intf || scalar(@interfaces));
}
if (!(-e $network::tools::connect_file && -e $network::tools::disconnect_file)) {
$button_connect->set_sensitive(0);