From 337305ef81675c30162e9ce7d373ade32bf643c1 Mon Sep 17 00:00:00 2001 From: Jan Paul Tuecking Date: Sat, 4 Dec 2010 19:44:11 +0100 Subject: [PATCH] Added messages into the webif to tell the user a reboot is required --- html/cgi-bin/index.cgi | 12 +++++++++++- html/cgi-bin/pakfire.cgi | 12 ++++++++++++ langs/de/cgi-bin/de.pl | 1 + langs/en/cgi-bin/en.pl | 1 + langs/es/cgi-bin/es.pl | 1 + langs/fr/cgi-bin/fr.pl | 1 + 6 files changed, 27 insertions(+), 1 deletion(-) mode change 100644 => 100755 html/cgi-bin/index.cgi diff --git a/html/cgi-bin/index.cgi b/html/cgi-bin/index.cgi old mode 100644 new mode 100755 index dfe65bf81..b85b22ce8 --- a/html/cgi-bin/index.cgi +++ b/html/cgi-bin/index.cgi @@ -39,6 +39,7 @@ my $warnmessage = ''; my $refresh = ""; my $ipaddr=''; + &Header::showhttpheaders(); $cgiparams{'ACTION'} = ''; @@ -57,6 +58,12 @@ my %mainsettings = (); my $connstate = &Header::connectionstatus(); +# check if reboot is necessary +my $reboot = 0; +if (`find /var/run/need_reboot 2>/dev/null`) { + $reboot = 1; +} + if ($cgiparams{'ACTION'} eq $Lang::tr{'shutdown'} || $cgiparams{'ACTION'} eq $Lang::tr{'reboot'}) { $refresh = ""; } elsif ($connstate =~ /$Lang::tr{'connecting'}/ || /$Lang::tr{'connection closed'}/ ){ @@ -428,6 +435,7 @@ foreach my $file (@files) { } } + if ($warnmessage) { print "$warnmessage"; } @@ -437,8 +445,10 @@ END ; &Pakfire::dblist("upgrade", "notice"); print <$Lang::tr{'needreboot'}!"; +} } else { my $message=''; if ($death) { diff --git a/html/cgi-bin/pakfire.cgi b/html/cgi-bin/pakfire.cgi index 9cfe83eec..414958e50 100644 --- a/html/cgi-bin/pakfire.cgi +++ b/html/cgi-bin/pakfire.cgi @@ -57,6 +57,12 @@ sub refreshpage{&Header::openbox( 'Waiting', 1, "/dev/null`) { + $reboot = 1; +} + if ($pakfiresettings{'ACTION'} eq 'install'){ $pakfiresettings{'INSPAKS'} =~ s/\|/\ /g; if ("$pakfiresettings{'FORCE'}" eq "on") { @@ -229,6 +235,12 @@ my $packages_update_age = &General::age("/opt/pakfire/db/lists/packages_list.db" print < +END +if ($reboot == 1) { + print "$Lang::tr{'needreboot'}!"; + print " " +} +print <$Lang::tr{'pakfire system state'}: $Lang::tr{'pakfire core update level'}: $core_release
diff --git a/langs/de/cgi-bin/de.pl b/langs/de/cgi-bin/de.pl index e02702ce1..3910ef7fe 100644 --- a/langs/de/cgi-bin/de.pl +++ b/langs/de/cgi-bin/de.pl @@ -1170,6 +1170,7 @@ 'name must only contain characters' => 'Name darf nur Buchstaben enthalten.', 'name too long' => 'Der volle Benutzername oder der System Hostname ist zu lang', 'nat-traversal' => 'Nat Traversal:', +'needreboot' => 'Ein Update benötigt einen Neustart', 'net' => 'Netz', 'net address' => 'Netzadresse', 'net config' => 'Netzwerk-Konfiguration', diff --git a/langs/en/cgi-bin/en.pl b/langs/en/cgi-bin/en.pl index bbd01b164..e73f741c6 100644 --- a/langs/en/cgi-bin/en.pl +++ b/langs/en/cgi-bin/en.pl @@ -1197,6 +1197,7 @@ 'name must only contain characters' => 'Name must only contain characters.', 'name too long' => 'User\'s full name or system hostname is too long', 'nat-traversal' => 'Nat Traversal:', +'needreboot' => 'An update requires a restart', 'net' => 'Net', 'net address' => 'net address', 'net config' => 'Network configuration', diff --git a/langs/es/cgi-bin/es.pl b/langs/es/cgi-bin/es.pl index 612f1bf1c..778799159 100644 --- a/langs/es/cgi-bin/es.pl +++ b/langs/es/cgi-bin/es.pl @@ -1195,6 +1195,7 @@ 'name must only contain characters' => 'El nombre solo puede contener caracteres', 'name too long' => 'Nombre de usuario o de host es demasiado largo', 'nat-traversal' => 'NAT Transversal:', +'needreboot' => 'An update requires a restart', 'net' => 'Red', 'net address' => 'dirección de red', 'net config' => 'Configuración de red', diff --git a/langs/fr/cgi-bin/fr.pl b/langs/fr/cgi-bin/fr.pl index ff07c8bd5..058276fa0 100644 --- a/langs/fr/cgi-bin/fr.pl +++ b/langs/fr/cgi-bin/fr.pl @@ -1196,6 +1196,7 @@ 'name must only contain characters' => 'Le nom ne doit contenir que des caractères.', 'name too long' => 'Le nom d\'utilisateur ou du système hôte est trop long', 'nat-traversal' => 'Nat Traversal :', +'needreboot' => 'An update requires a restart', 'net' => 'Réseau', 'net address' => 'adresse net', 'net config' => 'Configuration réseau', -- 2.39.2