summaryrefslogtreecommitdiffstats
path: root/perl-install/standalone/drakroam
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.org>2004-08-11 14:48:49 +0000
committerOlivier Blin <oblin@mandriva.org>2004-08-11 14:48:49 +0000
commite560f277e840a949e7c9535bb293b658e5a92d95 (patch)
tree792dd194d5e8e9abbbf445fdcea66372b2886782 /perl-install/standalone/drakroam
parent7a1c2b1e9514f9cd6113a6083315dd7ad2674424 (diff)
downloaddrakx-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/drakroam')
-rwxr-xr-xperl-install/standalone/drakroam13
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 {