X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=html%2Fcgi-bin%2Findex.cgi;h=5c0376aeeef56a4f63f4e948d05aebe733624f5b;hb=7274a673f0e2941c17c0745285d2f46f97728db3;hp=df783151516ec2ed25436fc3a7cc18ab136f8110;hpb=19b01b74f9b9e7cb01943f6c118b45d1eced9b4c;p=people%2Fteissler%2Fipfire-2.x.git
diff --git a/html/cgi-bin/index.cgi b/html/cgi-bin/index.cgi
index df7831515..5c0376aee 100644
--- a/html/cgi-bin/index.cgi
+++ b/html/cgi-bin/index.cgi
@@ -28,6 +28,7 @@ use strict;
require '/var/ipfire/general-functions.pl';
require "${General::swroot}/lang.pl";
require "${General::swroot}/header.pl";
+require "/opt/pakfire/lib/functions.pl";
my %cgiparams=();
my %pppsettings=();
@@ -38,6 +39,7 @@ my $warnmessage = '';
my $refresh = "";
my $ipaddr='';
+
&Header::showhttpheaders();
$cgiparams{'ACTION'} = '';
@@ -56,6 +58,14 @@ 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'}/ ){
@@ -127,8 +137,13 @@ my $dialButtonDisabled = "disabled='disabled'";
&Header::openpage($Lang::tr{'main page'}, 1, $refresh);
&Header::openbigbox('', 'center');
-&Header::openbox('100%', 'center', &Header::cleanhtml(`/bin/uname -n`,"y"));
+# licence agreement
+if ($cgiparams{'ACTION'} eq $Lang::tr{'yes'} && $cgiparams{'gpl_accepted'} eq '1') {
+ system('touch /var/ipfire/main/gpl_accepted')
+}
+if (`find /var/ipfire/main/gpl_accepted 2>/dev/null`) {
+&Header::openbox('100%', 'center', &Header::cleanhtml(`/bin/uname -n`,"y"));
if ( ( $pppsettings{'VALID'} eq 'yes' && $modemsettings{'VALID'} eq 'yes' ) || ( $netsettings{'CONFIG_TYPE'} =~ /^(1|2|3|4)$/ && $netsettings{'RED_TYPE'} =~ /^(DHCP|STATIC)$/ )) {
@@ -313,9 +328,9 @@ END
END
if ( `cat /var/ipfire/proxy/advanced/settings | grep ^ENABLE=on` ) {
- print "Proxy an";
+ print $Lang::tr{'advproxy on'};
if ( `cat /var/ipfire/proxy/advanced/settings | grep ^TRANSPARENT=on` ) { print " (transparent)"; }
- } else { print "Proxy aus"; }
+ } else { print $Lang::tr{'advproxy off'}; }
}
if ( $netsettings{'BLUE_DEV'} ) { print <$Lang::tr{'wireless'}
@@ -323,9 +338,9 @@ END
|
END
if ( `cat /var/ipfire/proxy/advanced/settings | grep ^ENABLE_BLUE=on` ) {
- print "Proxy an";
+ print $Lang::tr{'advproxy on'};
if ( `cat /var/ipfire/proxy/advanced/settings | grep ^TRANSPARENT_BLUE=on` ) { print " (transparent)"; }
- } else { print "Proxy aus"; }
+ } else { print $Lang::tr{'advproxy off'}; }
}
if ( $netsettings{'ORANGE_DEV'} ) { print <$Lang::tr{'dmz'}
@@ -336,7 +351,7 @@ END
if ( `cat /var/ipfire/vpn/settings | grep ^ENABLED=on` ||
`cat /var/ipfire/vpn/settings | grep ^ENABLED_BLUE=on` ) {
my $ipsecip = `cat /var/ipfire/vpn/settings | grep ^VPN_IP= | cut -c 8-`;
- my @status = `/usr/sbin/ipsec auto --status`;
+ my @status = `/usr/local/bin/ipsecctrl I`;
my %confighash = ();
&General::readhasharray("${General::swroot}/vpn/config", \%confighash);
print <90) {
@temp = split(/ /,$line);
$temp2=int(100-$1);
- $warnmessage .= "$Lang::tr{'filesystem full'}: $temp[0] $Lang::tr{'free'}=$temp2% !\n";
+ $warnmessage .= " $Lang::tr{'filesystem full'}: $temp[0] $Lang::tr{'free'}=$temp2% !\n";
}
}
}
+# S.M.A.R.T. health warning
+my @files = `/bin/ls /var/run/smartctl_out_hddtemp-*`;
+foreach my $file (@files) {
+ chomp ($file);
+ my $disk=`echo $file | cut -d"-" -f2`;
+ chomp ($disk);
+ if (`/bin/grep "SAVE ALL DATA" $file`) {
+ $warnmessage .= " $Lang::tr{'smartwarn1'} /dev/$disk $Lang::tr{'smartwarn2'} !\n\n";
+ }
+}
+
+
if ($warnmessage) {
print "$warnmessage";
}
print <
-
END
+;
+&Pakfire::dblist("upgrade", "notice");
+print < $Lang::tr{'needreboot'}!";
+}
} else {
my $message='';
if ($death) {
@@ -446,5 +479,37 @@ END
}
&Header::closebox();
+}
+
+else {
+&Header::openbox('100%', 'left', $Lang::tr{'gpl license agreement'});
+print <
+END
+;
+if (`find /usr/share/doc/licenses/GPLv3 2>/dev/null`) {
+ print ''
+}
+else {
+ print ' GNU GENERAL PUBLIC LICENSE '
+}
+print <
+
+
+ $Lang::tr{'gpl unofficial translation of the general public license v3'}
+
+END
+
+&Header::closebox();
+}
+
&Header::closebigbox();
&Header::closepage();
| | | |