diff options
Diffstat (limited to 'mdkapplet')
-rwxr-xr-x | mdkapplet | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -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 = (); |