summaryrefslogtreecommitdiffstats
path: root/mdkapplet
diff options
context:
space:
mode:
Diffstat (limited to 'mdkapplet')
-rwxr-xr-xmdkapplet9
1 files changed, 7 insertions, 2 deletions
diff --git a/mdkapplet b/mdkapplet
index bcb25d2e..4ac2031b 100755
--- a/mdkapplet
+++ b/mdkapplet
@@ -48,6 +48,10 @@ my $localfile = "$localdir/mdkonline";
mkdir_p($localdir) if !-d $localdir;
-e "$ENV{HOME}/.mdkonline" and system("mv", "$ENV{HOME}/.mdkonline", "$localfile");
+#don't launch it twice :)
+my @pids = fuzzy_pidofs(qr/\bmdkapplet\b/);
+@pids > 1 and die "mdkapplet already running\n";
+
my %state = (
okay => {
colour => [ 'okay' ],
@@ -176,7 +180,7 @@ sub setLabel {
gtkflush();
}
sub configNetwork { logIt(N("Launching drakconnect\n")); system "/usr/sbin/drakconnect &" }
-sub installUpdates { logIt(N("Launching mdkupdate --applet\n")); gtkroot()->set_cursor(Gtk2::Gdk::Cursor->new('watch')); system "/usr/sbin/mdkupdate", "--applet"; silentCheck(); gtkflush; gtkroot()->set_cursor(Gtk2::Gdk::Cursor->new('left-ptr')); }
+sub installUpdates { logIt(N("Launching mdkupdate --applet\n")); gtkroot()->set_cursor(Gtk2::Gdk::Cursor->new('watch')); system "/usr/sbin/mdkupdate", "--applet"; silentCheck(); gtkflush(); gtkroot()->set_cursor(Gtk2::Gdk::Cursor->new('left-ptr')); }
sub silentCheck {
my $link = "http://www.mandrakeonline.net/online3_RemoteAction.php" . '?action=UpdateList';
my %h = getVarsFromSh($conffile);
@@ -220,7 +224,8 @@ sub silentCheck {
96 => sub { logIt(N("Unknown state")) ; go2State('okay') },
97 => sub { logIt(N("Online services disabled. Contact MandrakeOnline site\n")) ; go2State('disabled'); },
98 => sub { logIt(N("Wrong Password.\n")); go2State('critical'); },
- 99 => sub { logIt(N("Wrong Action or host or login.\n")); go2State('critical'); }
+ 99 => sub { logIt(N("Wrong Action or host or login.\n")); go2State('critical'); },
+ 500 => sub { logIt(N("Something is wrong with your network settings (check your route, firewall or proxy settings)\n")); go2State('critical') }
};
$retcode->{$u}->();
}