X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=html%2Fcgi-bin%2Fpakfire.cgi;h=143f123b7f71853905175421fe21c55cb73ea96f;hb=7383bf2b1bdd343dcbe1f9f49f76cbc157316ee1;hp=513730bf3d13b16577da473843c9c70ab2c55fe7;hpb=d40aff3516401094f0732bfbaa3549b592045ccd;p=ipfire-2.x.git diff --git a/html/cgi-bin/pakfire.cgi b/html/cgi-bin/pakfire.cgi index 513730bf3d..143f123b7f 100644 --- a/html/cgi-bin/pakfire.cgi +++ b/html/cgi-bin/pakfire.cgi @@ -2,7 +2,7 @@ ############################################################################### # # # IPFire.org - A linux based firewall # -# Copyright (C) 2007 Michael Tremer & Christian Schmidt # +# Copyright (C) 2007-2011 Michael Tremer & Christian Schmidt # # # # This program is free software: you can redistribute it and/or modify # # it under the terms of the GNU General Public License as published by # @@ -43,9 +43,11 @@ $pakfiresettings{'VALID'} = ''; $pakfiresettings{'INSPAKS'} = ''; $pakfiresettings{'DELPAKS'} = ''; $pakfiresettings{'AUTOUPDATE'} = 'off'; -$pakfiresettings{'AUTOUPGRADE'} = 'off'; +$pakfiresettings{'HEALTHCHECK'} = 'on'; $pakfiresettings{'UUID'} = 'on'; +sub refreshpage{&Header::openbox( 'Waiting', 1, "" );print "

$Lang::tr{'pagerefresh'}
";&Header::closebox();} + &Header::getcgihash(\%pakfiresettings); &General::readhash("${General::swroot}/main/settings", \%mainsettings); @@ -59,15 +61,16 @@ if ($pakfiresettings{'ACTION'} eq 'install'){ if ("$pakfiresettings{'FORCE'}" eq "on") { my $command = "/usr/local/bin/pakfire install --non-interactive --no-colors $pakfiresettings{'INSPAKS'} &>/dev/null &"; system("$command"); - sleep(2); + system("/bin/sleep 1"); } else { - &Header::openbox("100%", "center", "Abfrage"); + &Header::openbox("100%", "center", $Lang::tr{'request'}); my @output = `/usr/local/bin/pakfire resolvedeps --no-colors $pakfiresettings{'INSPAKS'}`; print <$Lang::tr{'pakfire install package'}.$pakfiresettings{'INSPAKS'}.$Lang::tr{'pakfire possible dependency'} -
		
+		
 END
 		foreach (@output) {
+		  $_ =~ s/\\[[0-1]\;[0-9]+m//g;
 			print "$_\n";
 		}
 		print <
 							
 							
-							
+							
 						
 				
 						
- +
END @@ -98,15 +101,16 @@ END if ("$pakfiresettings{'FORCE'}" eq "on") { my $command = "/usr/local/bin/pakfire remove --non-interactive --no-colors $pakfiresettings{'DELPAKS'} &>/dev/null &"; system("$command"); - sleep(2); + system("/bin/sleep 1"); } else { - &Header::openbox("100%", "center", "Abfrage"); + &Header::openbox("100%", "center", $Lang::tr{'request'}); my @output = `/usr/local/bin/pakfire resolvedeps --no-colors $pakfiresettings{'DELPAKS'}`; print <$Lang::tr{'pakfire uninstall package'}.$pakfiresettings{'DELPAKS'}.$Lang::tr{'pakfire possible dependency'} -
		
+		
 END
 		foreach (@output) {
+		  $_ =~ s/\\[[0-1]\;[0-9]+m//g;
 			print "$_\n";
 		}
 		print <
 							
 							
-							
+							
 						
 				
 						
- +
END @@ -133,25 +137,19 @@ END } } elsif ($pakfiresettings{'ACTION'} eq 'update') { - - system("/usr/local/bin/pakfire update --force --no-colors &>/dev/null"); + system("/usr/local/bin/pakfire update --force --no-colors &>/dev/null &"); + system("/bin/sleep 1"); } elsif ($pakfiresettings{'ACTION'} eq 'upgrade') { - - system("/usr/local/bin/pakfire upgrade -y --no-colors &>/dev/null"); - + my $command = "/usr/local/bin/pakfire upgrade -y --no-colors &>/dev/null &"; + system("$command"); + system("/bin/sleep 1"); } elsif ($pakfiresettings{'ACTION'} eq "$Lang::tr{'save'}") { - if ($pakfiresettings{'AUTOUPDATE'} == "on") { - system("/usr/local/bin/pakfire enable updates"); - } else { - system("/usr/local/bin/pakfire disable updates"); - } - - if ($pakfiresettings{'AUTOUPGRADE'} == "on") { - system("/usr/local/bin/pakfire enable upgrades"); + if ($pakfiresettings{'AUTOUPDATE'} eq 'on') { + system("/usr/local/bin/pakfire enable updates >/dev/null 2>&1"); } else { - system("/usr/local/bin/pakfire disable upgrades"); + system("/usr/local/bin/pakfire disable updates >/dev/null 2>&1"); } &General::writehash("${General::swroot}/pakfire/settings", \%pakfiresettings); @@ -165,9 +163,9 @@ my %checked=(); $checked{'AUTOUPDATE'}{'off'} = ''; $checked{'AUTOUPDATE'}{'on'} = ''; $checked{'AUTOUPDATE'}{$pakfiresettings{'AUTOUPDATE'}} = "checked='checked'"; -$checked{'AUTOUPGRADE'}{'off'} = ''; -$checked{'AUTOUPGRADE'}{'on'} = ''; -$checked{'AUTOUPGRADE'}{$pakfiresettings{'AUTOUPGRADE'}} = "checked='checked'"; +$checked{'HEALTHCHECK'}{'off'} = ''; +$checked{'HEALTHCHECK'}{'on'} = ''; +$checked{'HEALTHCHECK'}{$pakfiresettings{'HEALTHCHECK'}} = "checked='checked'"; $checked{'UUID'}{'off'} = ''; $checked{'UUID'}{'on'} = ''; $checked{'UUID'}{$pakfiresettings{'UUID'}} = "checked='checked'"; @@ -186,30 +184,31 @@ if ($return) { print < - $Lang::tr{  + $Lang::tr{  $Lang::tr{'pakfire working'}
- +
-
+		
 END
-	my @output = `tail -20 /var/log/pakfire.log`;
+	my @output = `grep pakfire /var/log/messages | tail -20`;
 	foreach (@output) {
-		print "$_";
+		print "$_
"; } print < +
END &Header::closebox(); &Header::closebigbox(); &Header::closepage(); exit; + refreshpage(); } -my $core_release = `cat /opt/pakfire/db/core/mine`; +my $core_release = `cat /opt/pakfire/db/core/mine 2>/dev/null`; chomp($core_release); my $core_update_age = &General::age("/opt/pakfire/db/core/mine"); my $corelist_update_age = &General::age("/opt/pakfire/db/lists/core-list.db"); @@ -220,16 +219,22 @@ my $packages_update_age = &General::age("/opt/pakfire/db/lists/packages_list.db" print < +END +if ( -e "/var/run/need_reboot") { + print "$Lang::tr{'needreboot'}!"; + print " " +} +print <$Lang::tr{'pakfire system state'}: $Lang::tr{'pakfire core update level'}: $core_release
- $Lang::tr{'pakfire last update'} $core_update_age ago
- $Lang::tr{'pakfire last serverlist update'} $server_update_age ago
- $Lang::tr{'pakfire last core list update'} $corelist_update_age ago
- $Lang::tr{'pakfire last package update'} $packages_update_age ago + $Lang::tr{'pakfire last update'} $core_update_age $Lang::tr{'pakfire ago'}
+ $Lang::tr{'pakfire last serverlist update'} $server_update_age $Lang::tr{'pakfire ago'}
+ $Lang::tr{'pakfire last core list update'} $corelist_update_age $Lang::tr{'pakfire ago'}
+ $Lang::tr{'pakfire last package update'} $packages_update_age $Lang::tr{'pakfire ago'}
-
+
@@ -240,24 +245,24 @@ END
- +
- +   $Lang::tr{'pakfire available addons'} $Lang::tr{'pakfire installed addons'}

$Lang::tr{'pakfire install description'}

-
+ - +
@@ -272,7 +277,7 @@ print <
- + END @@ -284,16 +289,16 @@ print < - - - + - +
$Lang::tr{'basic options'}
$Lang::tr{'pakfire update daily'} - on / +
$Lang::tr{'pakfire update daily'} + on | off
$Lang::tr{'pakfire core update auto'} - on / - off
$Lang::tr{'pakfire register'} - on / +
$Lang::tr{'pakfire health check'} + on | + off
$Lang::tr{'pakfire register'} + on | off
END