summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2007-09-28 17:51:41 +0000
committerOlivier Blin <oblin@mandriva.com>2007-09-28 17:51:41 +0000
commitf39be2bcc72c1e88959d0d811cc7056b330407cb (patch)
treea1d8013835f20f022b58b7c96fe72b8903b32e23 /bin
parentf8dd5798b81725c19f2460059fdc204aadec9d99 (diff)
downloaddrakx-net-f39be2bcc72c1e88959d0d811cc7056b330407cb.tar
drakx-net-f39be2bcc72c1e88959d0d811cc7056b330407cb.tar.gz
drakx-net-f39be2bcc72c1e88959d0d811cc7056b330407cb.tar.bz2
drakx-net-f39be2bcc72c1e88959d0d811cc7056b330407cb.tar.xz
drakx-net-f39be2bcc72c1e88959d0d811cc7056b330407cb.zip
check for draknetcenter/drakroam instances of root, not user
Diffstat (limited to 'bin')
-rwxr-xr-xbin/net_applet9
1 files changed, 5 insertions, 4 deletions
diff --git a/bin/net_applet b/bin/net_applet
index cc7e3d5..834aff1 100755
--- a/bin/net_applet
+++ b/bin/net_applet
@@ -197,11 +197,12 @@ Gtk2->main;
ugtk2::exit(0);
sub is_running {
- my ($name) = @_;
+ my ($name, $o_user) = @_;
+ my $user = $o_user || $ENV{USER};
any {
my ($ppid, $pid, $n) = /^\s*(\d+)\s+(\d+)\s+(.*)/;
$ppid != 1 && $pid != $$ && $n eq $name;
- } `ps -o '%P %p %c' -u $ENV{USER}`;
+ } `ps -o '%P %p %c' -u $o_user`;
}
sub shouldStart() {
my ($opt) = @ARGV;
@@ -214,11 +215,11 @@ sub run_net_monitor() {
run_program::raw({ detach => 1 }, '/usr/sbin/net_monitor', '--defaultintf', $current_interface) unless is_running('net_monitor');
}
sub run_netcenter() {
- run_program::raw({ detach => 1 }, '/usr/bin/draknetcenter') unless is_running('draknetcenter');
+ run_program::raw({ detach => 1 }, '/usr/bin/draknetcenter') unless is_running('draknetcenter', 'root');
}
sub run_drakroam {
my ($o_ap) = @_;
- run_program::raw({ detach => 1 }, '/usr/sbin/drakroam', if_($o_ap, "--ap=$o_ap")) unless is_running('drakroam');
+ run_program::raw({ detach => 1 }, '/usr/sbin/drakroam', if_($o_ap, "--ap=$o_ap")) unless is_running('drakroam', 'root');
}
sub run_drakids() {
$ifw_alert = 0;