summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xmdkapplet10
1 files changed, 5 insertions, 5 deletions
diff --git a/mdkapplet b/mdkapplet
index 82af6d10..403e429c 100755
--- a/mdkapplet
+++ b/mdkapplet
@@ -51,11 +51,7 @@ my $localfile = "$localdir/mdkonline";
mkdir_p($localdir) if !-d $localdir;
-e "$ENV{HOME}/.mdkonline" and system("mv", "$ENV{HOME}/.mdkonline", "$localfile");
-my @pids = `ps -u $ENV{USER} | grep mdkapplet`;
-@pids > 1 and die "mdkapplet already running\n";
-#don't launch it twice :)
-#my @pids = fuzzy_pidofs(qr/\bmdkapplet\b/);
-#@pids > 1 and die "mdkapplet already running\n";
+is_running('mdkapplet') and die "mdkapplet already running\n";
my %state = (
okay => {
@@ -271,6 +267,10 @@ sub compareWithInstalled {
}
$isUpdate
}
+sub is_running {
+ my ($name) = @_;
+ any { !/^\s*$$\b/ && /\b\Q$name\E$/ } `ps -u $ENV{USER}`;
+}
sub rpmverparse {
my ($ver) = @_;
my @verparts = ();