diff options
author | Olivier Blin <oblin@mandriva.org> | 2004-08-11 14:48:49 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.org> | 2004-08-11 14:48:49 +0000 |
commit | e560f277e840a949e7c9535bb293b658e5a92d95 (patch) | |
tree | 792dd194d5e8e9abbbf445fdcea66372b2886782 /perl-install/standalone | |
parent | 7a1c2b1e9514f9cd6113a6083315dd7ad2674424 (diff) | |
download | drakx-e560f277e840a949e7c9535bb293b658e5a92d95.tar drakx-e560f277e840a949e7c9535bb293b658e5a92d95.tar.gz drakx-e560f277e840a949e7c9535bb293b658e5a92d95.tar.bz2 drakx-e560f277e840a949e7c9535bb293b658e5a92d95.tar.xz drakx-e560f277e840a949e7c9535bb293b658e5a92d95.zip |
introduce and use isRoamingRunning to detect if the roaming daemon is
running (woah, sector clear, titi is gone home, no more cvs conflicts)
Diffstat (limited to 'perl-install/standalone')
-rwxr-xr-x | perl-install/standalone/drakroam | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/perl-install/standalone/drakroam b/perl-install/standalone/drakroam index cfad91c3a..eab863caf 100755 --- a/perl-install/standalone/drakroam +++ b/perl-install/standalone/drakroam @@ -231,9 +231,14 @@ sub UpdateAll { &UpdateRoaming; } +sub isRoamingRunning() { + my $name = basename($roaming_daemon->{binary}); + any { /\Q$name\E$/ } run_program::get_stdout("ps", "-A"); +} + sub UpdateRoaming() { my $name = basename($roaming_daemon->{binary}); - my $status = (any { /\Q$name\E$/ } run_program::get_stdout("ps", "-A")) ? "on" : "off"; + my $status = isRoamingRunning() ? "on" : "off"; $RoamStatus->set_text("Roaming: $status"); return FALSE; #- do not update again if launched on timeout } @@ -314,8 +319,10 @@ sub StopRoam() { sub SetInterval() { $ScanInterval = $ScanEntry->get_text; - StopRoam(); - StartRoam(); + if (isRoamingRunning()) { + StopRoam(); + StartRoam(); + } } sub ConnectNow { |