X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=html%2Fcgi-bin%2Fpakfire.cgi;h=2a7ca8407f08a29546cb5bf9148a2cc824ac4dc6;hb=8b40eca59ec98f19544e68342db7ee24d5983aa6;hp=ccde0298c3c32b62144e205af98a545aab6e6032;hpb=5b2a12ff8ad39591a5a57a0f2122edc2934f5ec3;p=people%2Fteissler%2Fipfire-2.x.git
diff --git a/html/cgi-bin/pakfire.cgi b/html/cgi-bin/pakfire.cgi
index ccde0298c..2a7ca8407 100644
--- a/html/cgi-bin/pakfire.cgi
+++ b/html/cgi-bin/pakfire.cgi
@@ -1,18 +1,29 @@
#!/usr/bin/perl
-#
-# IPFire CGIs
-#
-# This file is part of the IPFire Project
-#
-# This code is distributed under the terms of the GPL
-#
-#
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# 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 #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see
+
$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 + foreach (@output) { + $_ =~ s/\\[[0-1]\;[0-9]+m//g; + print "$_\n"; + } + print <+ $Lang::tr{'pakfire accept all'} + + + + + +END + &Header::closebox(); + &Header::closebigbox(); + &Header::closepage(); + exit; + } + } elsif ($pakfiresettings{'ACTION'} eq 'update') { - - system("/usr/local/bin/pakfire update --force"); -} elsif ($pakfiresettings{'ACTION'} eq 'unlock') { - - &Pakfire::lock("off"); - + system("/usr/local/bin/pakfire update --force --no-colors &>/dev/null &"); + system("/bin/sleep 1"); +} elsif ($pakfiresettings{'ACTION'} eq 'upgrade') { + 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'} eq 'on') { + system("/usr/local/bin/pakfire enable updates >/dev/null 2>&1"); + } else { + system("/usr/local/bin/pakfire disable updates >/dev/null 2>&1"); + } + &General::writehash("${General::swroot}/pakfire/settings", \%pakfiresettings); } @@ -95,6 +163,12 @@ my %checked=(); $checked{'AUTOUPDATE'}{'off'} = ''; $checked{'AUTOUPDATE'}{'on'} = ''; $checked{'AUTOUPDATE'}{$pakfiresettings{'AUTOUPDATE'}} = "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'"; # DPC move error message to top so it is seen! if ($errormessage) { @@ -103,73 +177,128 @@ if ($errormessage) { &Header::closebox(); } -if ( -e "/opt/pakfire/pakfire.lock" ) { - &Header::openbox("100%", "center", "Aktiv"); +my $return = `pidof pakfire`; +chomp($return); +if ($return) { + &Header::openbox( 'Waiting', 1, "" ); print < - + ![]()
- Pakfire fuehrt gerade eine Aufgabe aus... Bitte warten sie, bis diese erfolgreich beendet wurde. + $Lang::tr{'pakfire working'} - + +END + my @output = `grep pakfire /var/log/messages | tail -20`; + foreach (@output) { + print "$_"; + } + print <+ END &Header::closebox(); &Header::closebigbox(); &Header::closepage(); exit; + refreshpage(); } +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"); +my $server_update_age = &General::age("/opt/pakfire/db/lists/server-list.db"); +my $packages_update_age = &General::age("/opt/pakfire/db/lists/packages_list.db"); + &Header::openbox("100%", "center", "Pakfire"); print < - Verfuegbare Addons:
++END +if ( -e "/var/run/need_reboot") { + print "
-"; + print " $Lang::tr{'needreboot'}! " +} +print < $Lang::tr{'pakfire system state'}: + + $Lang::tr{'pakfire core update level'}: $core_release
+ $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'} + ++ + + + $Lang::tr{'pakfire available addons'} + $Lang::tr{'pakfire installed addons'} + + -$Lang::tr{'pakfire install description'}
+ -
- -
- - - -Installierte Addons:
+ ++ $Lang::tr{'pakfire uninstall description'}
+
+ +
+ + + + +END + +&Header::closebox(); +&Header::openbox("100%", "center", "$Lang::tr{'settings'}"); + +print <- -
Automatische Updates taeglich ausfuehren: - - Test: - - + +
END+ $Lang::tr{'basic options'} + $Lang::tr{'pakfire update daily'} + on | + off + $Lang::tr{'pakfire health check'} + on | + off + $Lang::tr{'pakfire register'} + on | + off