]> git.ipfire.org Git - ipfire-2.x.git/blame_incremental - html/cgi-bin/index.cgi
Merge remote-tracking branch 'alfh/feature_html_validating' into next
[ipfire-2.x.git] / html / cgi-bin / index.cgi
... / ...
CommitLineData
1#!/usr/bin/perl
2###############################################################################
3# #
4# IPFire.org - A linux based firewall #
5# Copyright (C) 2007-2014 IPFire Team <info@ipfire.org> #
6# #
7# This program is free software: you can redistribute it and/or modify #
8# it under the terms of the GNU General Public License as published by #
9# the Free Software Foundation, either version 3 of the License, or #
10# (at your option) any later version. #
11# #
12# This program is distributed in the hope that it will be useful, #
13# but WITHOUT ANY WARRANTY; without even the implied warranty of #
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
15# GNU General Public License for more details. #
16# #
17# You should have received a copy of the GNU General Public License #
18# along with this program. If not, see <http://www.gnu.org/licenses/>. #
19# #
20###############################################################################
21
22use strict;
23use Net::Telnet;
24use Sort::Naturally;
25
26# enable only the following on debugging purpose
27#use warnings;
28#use CGI::Carp 'fatalsToBrowser';
29
30require '/var/ipfire/general-functions.pl';
31require "${General::swroot}/lang.pl";
32require "${General::swroot}/header.pl";
33require "/opt/pakfire/lib/functions.pl";
34
35my %cgiparams=();
36my %pppsettings=();
37my %modemsettings=();
38my %netsettings=();
39my %ddnssettings=();
40my %proxysettings=();
41my %vpnsettings=();
42my %vpnconfig=();
43my %ovpnconfig=();
44my $warnmessage = '';
45my $refresh = "";
46my $ipaddr='';
47my $showbox=0;
48my $showipsec=0;
49my $showovpn=0;
50
51if ( ! -e "/var/ipfire/main/gpl_accepted" ) {
52 print "Status: 302 Moved Temporarily\n";
53 print "Location: gpl.cgi\n\n";
54 exit (0);
55}
56
57&Header::showhttpheaders();
58
59$cgiparams{'ACTION'} = '';
60&Header::getcgihash(\%cgiparams);
61$pppsettings{'VALID'} = '';
62$pppsettings{'PROFILENAME'} = 'None';
63&General::readhash("${General::swroot}/ppp/settings", \%pppsettings);
64&General::readhash("${General::swroot}/modem/settings", \%modemsettings);
65&General::readhash("${General::swroot}/ethernet/settings", \%netsettings);
66&General::readhash("${General::swroot}/ddns/settings", \%ddnssettings);
67&General::readhash("${General::swroot}/proxy/advanced/settings", \%proxysettings);
68&General::readhash("${General::swroot}/vpn/settings", \%vpnsettings);
69
70my %color = ();
71my %mainsettings = ();
72&General::readhash("${General::swroot}/main/settings", \%mainsettings);
73&General::readhash("/srv/web/ipfire/html/themes/".$mainsettings{'THEME'}."/include/colors.txt", \%color);
74
75my $connstate = &Header::connectionstatus();
76
77if ( -e "/var/ipfire/main/gpl-accepted" ) {
78 if ($connstate =~ /$Lang::tr{'connecting'}/ || /$Lang::tr{'connection closed'}/ ){
79 $refresh = "<meta http-equiv='refresh' content='5;'>";
80 }elsif ($connstate =~ /$Lang::tr{'dod waiting'}/ || -e "${General::swroot}/main/refreshindex") {
81 $refresh = "<meta http-equiv='refresh' content='30;'>";
82 }
83}
84
85if ($cgiparams{'ACTION'} eq $Lang::tr{'dial profile'})
86{
87 my $profile = $cgiparams{'PROFILE'};
88 my %tempcgiparams = ();
89 $tempcgiparams{'PROFILE'} = '';
90 &General::readhash("${General::swroot}/ppp/settings-$cgiparams{'PROFILE'}",
91 \%tempcgiparams);
92
93 # make a link from the selected profile to the "default" one.
94 unlink("${General::swroot}/ppp/settings");
95 link("${General::swroot}/ppp/settings-$cgiparams{'PROFILE'}",
96 "${General::swroot}/ppp/settings");
97 open (TMP, ">${General::swroot}/ppp/updatesettings");
98 close TMP;
99 # read in the new params "early" so we can write secrets.
100 %cgiparams = ();
101 &General::readhash("${General::swroot}/ppp/settings", \%cgiparams);
102 $cgiparams{'PROFILE'} = $profile;
103 $cgiparams{'BACKUPPROFILE'} = $profile;
104 &General::writehash("${General::swroot}/ppp/settings-$cgiparams{'PROFILE'}",
105 \%cgiparams);
106
107 # write secrets file.
108 open(FILE, ">/${General::swroot}/ppp/secrets") or die "Unable to write secrets file.";
109 flock(FILE, 2);
110 my $username = $cgiparams{'USERNAME'};
111 my $password = $cgiparams{'PASSWORD'};
112 print FILE "'$username' * '$password'\n";
113 chmod 0600, "${General::swroot}/ppp/secrets";
114 close FILE;
115
116 &General::log("$Lang::tr{'profile made current'} $tempcgiparams{'PROFILENAME'}");
117 $cgiparams{'ACTION'} = "$Lang::tr{'dial'}";
118}
119
120if ($cgiparams{'ACTION'} eq $Lang::tr{'dial'}) {
121 system('/usr/local/bin/redctrl start > /dev/null') == 0
122 or &General::log("Dial failed: $?"); sleep 1;
123}elsif ($cgiparams{'ACTION'} eq $Lang::tr{'hangup'}) {
124 system('/usr/local/bin/redctrl stop > /dev/null') == 0
125 or &General::log("Hangup failed: $?"); sleep 1;
126}
127
128my $c;
129my $maxprofiles = 5;
130my @profilenames = ();
131
132for ($c = 1; $c <= $maxprofiles; $c++)
133{
134 my %temppppsettings = ();
135 $temppppsettings{'PROFILENAME'} = '';
136 &General::readhash("${General::swroot}/ppp/settings-$c", \%temppppsettings);
137 $profilenames[$c] = $temppppsettings{'PROFILENAME'};
138}
139my %selected;
140for ($c = 1; $c <= $maxprofiles; $c++) {
141 $selected{'PROFILE'}{$c} = '';
142}
143$selected{'PROFILE'}{$pppsettings{'PROFILE'}} = "selected='selected'";
144my $dialButtonDisabled = "disabled='disabled'";
145
146&Header::openpage($Lang::tr{'main page'}, 1, $refresh);
147&Header::openbigbox('', 'center');
148if (open(IPADDR,"${General::swroot}/red/local-ipaddress")) {
149 $ipaddr = <IPADDR>;
150 close IPADDR;
151 chomp ($ipaddr);
152 }
153
154&Header::openbox('100%', 'center', '');
155if ( ( $pppsettings{'VALID'} eq 'yes' && $modemsettings{'VALID'} eq 'yes' ) || ( $netsettings{'CONFIG_TYPE'} =~ /^(1|2|3|4)$/ && $netsettings{'RED_TYPE'} =~ /^(DHCP|STATIC)$/ )) {
156 if (open(IPADDR,"${General::swroot}/ddns/ipcache")) {
157 $ipaddr = <IPADDR>;
158 close IPADDR;
159 chomp ($ipaddr);
160 }
161 if (open(IPADDR,"${General::swroot}/red/local-ipaddress")) {
162 $ipaddr = <IPADDR>;
163 close IPADDR;
164 chomp ($ipaddr);
165 }
166} elsif ($modemsettings{'VALID'} eq 'no') {
167 print "$Lang::tr{'modem settings have errors'}\n </b></font>\n";
168} else {
169 print "$Lang::tr{'profile has errors'}\n </b></font>\n";
170}
171
172print <<END;
173<!-- Table of networks -->
174<table class='tbl' style='width:80%;'>
175 <tr>
176 <th style='background-color:$color{'color20'};'>$Lang::tr{'network'}</th>
177 <th style='background-color:$color{'color20'};'>$Lang::tr{'ip address'}</th>
178 <th style='background-color:$color{'color20'};'>$Lang::tr{'status'}</th>
179 </tr>
180 <tr>
181 <td style='width:25%; text-align:center; background-color:$Header::colourred;'><a href='/cgi-bin/pppsetup.cgi' style='color:white;'><b>$Lang::tr{'internet'}</b></a><br/></td>
182 <td style='width:30%; text-align:center;'>$ipaddr </td>
183 <td style='width:45%; text-align:center;'>$connstate </td>
184 </tr>
185END
186 my $HOSTNAME = (gethostbyaddr(pack("C4", split(/\./, $ipaddr)), 2))[0];
187 if ( "$HOSTNAME" ne "" ) {
188 print <<END;
189 <tr><td><b>$Lang::tr{'hostname'}:</b><td style='text-align:center;'>$HOSTNAME</td><td></td>
190END
191 }
192
193 if ( -e "${General::swroot}/red/remote-ipaddress" ) {
194 open (TMP, "<${General::swroot}/red/remote-ipaddress");
195 my $GATEWAY = <TMP>;
196 chomp($GATEWAY);
197 close TMP;
198 print <<END;
199 <tr><td><b>$Lang::tr{'gateway'}:</b><td style='text-align:center;'>$GATEWAY</td><td></td></tr>
200END
201 }
202
203 my @dns_servers = ();
204 foreach my $f ("${General::swroot}/red/dns1", "${General::swroot}/red/dns2") {
205 open(DNS, "<$f");
206 my $dns_server = <DNS>;
207 close(DNS);
208
209 chomp($dns_server);
210 if ($dns_server) {
211 push(@dns_servers, $dns_server);
212 }
213 }
214 my $dns_servers_str = join(", ", @dns_servers);
215
216 print <<END;
217 <tr>
218 <td>
219 <b>$Lang::tr{'dns servers'}:</b>
220 </td>
221 <td style='text-align:center;'>
222 $dns_servers_str
223 </td>
224 <td></td>
225 </tr>
226 </table>
227END
228
229#Dial profiles
230if ( $netsettings{'RED_TYPE'} ne "STATIC" && $netsettings{'RED_TYPE'} ne "DHCP" ){
231 # The dialctrl.pl script outputs html
232 print `/usr/local/bin/dialctrl.pl show`;
233 if ( ( $pppsettings{'VALID'} eq 'yes' ) || ( $netsettings{'CONFIG_TYPE'} =~ /^(1|2|3|4)$/ && $netsettings{'RED_TYPE'} =~ /^(DHCP|STATIC)$/ ) ) {
234 print <<END;
235 <br/>
236 <table style='width:80%;'>
237 <tr><td>
238 <form method='post' action='$ENV{'SCRIPT_NAME'}'>$Lang::tr{'profile'}:
239 <select name='PROFILE'>
240END
241 for ($c = 1; $c <= $maxprofiles; $c++)
242 {
243 if ($profilenames[$c] ne '') {
244 $dialButtonDisabled = "";
245 print "<option value='$c' $selected{'PROFILE'}{$c}>$c. $profilenames[$c]</option>";
246 }
247 }
248 $dialButtonDisabled = "disabled='disabled'" if (-e '/var/run/ppp-ipfire.pid' || -e "${General::swroot}/red/active");
249 print <<END;
250 </select>
251 <input type='submit' name='ACTION' value='$Lang::tr{'dial profile'}' $dialButtonDisabled />
252 </form>
253 </td>
254 <td style='text-align:center;'>
255 <table style='width:100%;'>
256 <tr>
257 <td style='width=50%; text-align:right;'>
258 <form method='post' action='$ENV{'SCRIPT_NAME'}'>
259 <input type='submit' name='ACTION' value='$Lang::tr{'dial'}'>
260 </form>
261 </td>
262 <td style='width=50%; text-align:left;'>
263 <form method='post' action='$ENV{'SCRIPT_NAME'}'>
264 <input type='submit' name='ACTION' value='$Lang::tr{'hangup'}'>
265 </form>
266 </td>
267 </tr>
268 </table>
269 </td>
270 </tr>
271 </table>
272END
273 } else {
274 print "<br/><span style='color:red;'>$Lang::tr{'profile has errors'}</span><br/>";
275 }
276}
277
278
279print <<END;
280<br/>
281<table class='tbl' style='width:80%;'>
282<tr>
283 <th>$Lang::tr{'network'}</th>
284 <th>$Lang::tr{'ip address'}</th>
285 <th>$Lang::tr{'status'}</th>
286</tr>
287END
288
289if ( $netsettings{'GREEN_DEV'} ) {
290 my $sub=&General::iporsubtocidr($netsettings{'GREEN_NETMASK'});
291 print <<END;
292 <tr>
293 <td style='width:25%; text-align:center; background-color:$Header::colourgreen;'>
294 <a href='/cgi-bin/dhcp.cgi' style='color:white'><b>$Lang::tr{'lan'}</b></a>
295 </td>
296 <td style='width:30%; text-align:center;'>$netsettings{'GREEN_ADDRESS'}/$sub</td>
297 <td style='width:45%; text-align:center;'>
298END
299 if ( $proxysettings{'ENABLE'} eq 'on' ) {
300 print $Lang::tr{'advproxy on'};
301 if ( $proxysettings{'TRANSPARENT'} eq 'on' ) { print " (transparent)"; }
302 } else { print $Lang::tr{'advproxy off'}; }
303 print '</td>';
304 print '</tr>';
305 }
306if ( $netsettings{'BLUE_DEV'} ) {
307 my $sub=&General::iporsubtocidr($netsettings{'BLUE_NETMASK'});
308 print <<END;
309 <tr>
310 <td style='width:25%; text-align:center; background-color:$Header::colourblue;'>
311 <a href='/cgi-bin/wireless.cgi' style='color:white'><b>$Lang::tr{'wireless'}</b></a>
312 </td>
313 <td style='width:30%; text-align:center;'>$netsettings{'BLUE_ADDRESS'}/$sub
314 <td style='width:45%; text-align:center;'>
315END
316 if ( $proxysettings{'ENABLE_BLUE'} eq 'on' ) {
317 print $Lang::tr{'advproxy on'};
318 if ( $proxysettings{'TRANSPARENT_BLUE'} eq 'on' ) { print " (transparent)"; }
319 } else { print $Lang::tr{'advproxy off'}; }
320 print '</td>';
321 print '</tr>';
322 }
323if ( $netsettings{'ORANGE_DEV'} ) {
324 my $sub=&General::iporsubtocidr($netsettings{'ORANGE_NETMASK'});
325 print <<END;
326 <tr>
327 <td style='width:25%; text-align:center; background-color:$Header::colourorange;'>
328 <a href='/cgi-bin/firewall.cgi' style='color:white'><b>$Lang::tr{'dmz'}</b></a>
329 </td>
330 <td style='width:30%; text-align:center;'>$netsettings{'ORANGE_ADDRESS'}/$sub</td>
331 <td style='width:45%; text-align:center; color:$Header::colourgreen;'>Online</td>
332 </tr>
333END
334 }
335#check if IPSEC is running
336if ( $vpnsettings{'ENABLED'} eq 'on' || $vpnsettings{'ENABLED_BLUE'} eq 'on' ) {
337 my $ipsecip = $vpnsettings{'VPN_IP'};
338print<<END;
339 <tr>
340 <td style='width:25%; text-align:center; background-color:$Header::colourvpn;'>
341 <a href='/cgi-bin/vpnmain.cgi' style='color:white'><b>$Lang::tr{'ipsec'}</b></a>
342 </td>
343 <td style='width:30%; text-align:center;'>$ipsecip</td>
344 <td style='width:45%; text-align:center; color:$Header::colourgreen;'>Online</td>
345 </tr>
346END
347}
348
349#check if OpenVPN is running
350my %confighash=();
351&General::readhash("${General::swroot}/ovpn/settings", \%confighash);
352
353if (($confighash{'ENABLED'} eq "on") ||
354 ($confighash{'ENABLED_BLUE'} eq "on") ||
355 ($confighash{'ENABLED_ORANGE'} eq "on")) {
356 my ($ovpnip,$sub) = split("/",$confighash{'DOVPN_SUBNET'});
357 $sub=&General::iporsubtocidr($sub);
358 $ovpnip="$ovpnip/$sub";
359print <<END;
360 <tr>
361 <td style='width:25%; text-align:center; background-color:$Header::colourvpn;'>
362 <a href='/cgi-bin/ovpnmain.cgi' style='color:white'><b>OpenVPN</b></a>
363 </td>
364 <td style='width:30%; text-align:center;'>$ovpnip</td>
365 <td style='width:45%; text-align:center; color:$Header::colourgreen;'>Online</td>
366 </tr>
367END
368 }
369print"</table>";
370&Header::closebox();
371
372#Check if there are any vpns configured (ipsec and openvpn)
373&General::readhasharray("${General::swroot}/vpn/config", \%vpnconfig);
374foreach my $key (sort { ncmp($vpnconfig{$a}[1],$vpnconfig{$b}[1]) } keys %vpnconfig) {
375 if ($vpnconfig{$key}[0] eq 'on'){
376 $showipsec=1;
377 $showbox=1;
378 last;
379 }
380}
381&General::readhasharray("${General::swroot}/ovpn/ovpnconfig", \%ovpnconfig);
382foreach my $dkey (sort { ncmp($ovpnconfig{$a}[1],$ovpnconfig{$b}[1])} keys %ovpnconfig) {
383 if (($ovpnconfig{$dkey}[3] eq 'net') && (-e "/var/run/$ovpnconfig{$dkey}[1]n2n.pid")){
384 $showbox=1;
385 $showovpn=1;
386 last;
387 }
388}
389
390if ($showbox){
391# Start of Box wich contains all vpn connections
392 &Header::openbox('100%', 'center', $Lang::tr{'vpn'});
393
394 #show ipsec connectiontable
395 if ( $showipsec ) {
396 my $ipsecip = $vpnsettings{'VPN_IP'};
397 my @status = `/usr/local/bin/ipsecctrl I`;
398 my %confighash = ();
399 my $id = 0;
400 my $gif;
401 my $col="";
402 my $count=0;
403 print <<END;
404 <table class='tbl' style='width:80%;'>
405 <tr>
406 <th style='width:40%;'>$Lang::tr{'ipsec network'}</th>
407 <th style='width:30%;'>$Lang::tr{'ip address'}</th>
408 <th style='width:30%;'>$Lang::tr{'status'}</th>
409 </tr>
410END
411 foreach my $key (sort { uc($vpnconfig{$a}[1]) cmp uc($vpnconfig{$b}[1]) } keys %vpnconfig) {
412 if ($vpnconfig{$key}[0] eq 'on') {
413 $count++;
414 my ($vpnip,$vpnsub) = split("/",$vpnconfig{$key}[11]);
415 $vpnsub=&General::iporsubtocidr($vpnsub);
416 $vpnip="$vpnip/$vpnsub";
417 if ($count % 2){
418 $col = $color{'color22'};
419 }else{
420 $col = $color{'color20'};
421 }
422 print "<tr>";
423 print "<td style='text-align:left; color:white; background-color:$Header::colourovpn;'>$vpnconfig{$key}[1]</td>";
424 print "<td style='text-align:left; background-color:$col'>$vpnip</td>";
425
426 my $activecolor = $Header::colourred;
427 my $activestatus = $Lang::tr{'capsclosed'};
428 if ($vpnconfig{$key}[0] eq 'off') {
429 $activecolor = $Header::colourblue;
430 $activestatus = $Lang::tr{'capsclosed'};
431 } else {
432 foreach my $line (@status) {
433 if (($line =~ /\"$vpnconfig{$key}[1]\".*IPsec SA established/) || ($line =~/$vpnconfig{$key}[1]\{.*INSTALLED/ )){
434 $activecolor = $Header::colourgreen;
435 $activestatus = $Lang::tr{'capsopen'};
436 }
437 }
438 }
439 print "<td style='text-align:center; color:white; background-color:$activecolor;'><b>$activestatus</b></td>";
440 print "</tr>";
441 }
442 }
443 print "</table>";
444 }
445
446 # Check if there is any OpenVPN connection configured.
447 if ( $showovpn ){
448 print <<END;
449 <br/>
450 <table class='tbl' style='width:80%;'>
451 <tr>
452 <th style='width:40%;'>$Lang::tr{'openvpn network'}</th>
453 <th style='width:30%;'>$Lang::tr{'ip address'}</th>
454 <th style='width:30%;'>$Lang::tr{'status'}</th>
455END
456
457 # Check if the OpenVPN server for Road Warrior Connections is running and display status information.
458 my $active;
459 my $count=0;
460 # Print the OpenVPN N2N connection status.
461 if ( -d "${General::swroot}/ovpn/n2nconf") {
462 my $col="";
463 foreach my $dkey (sort { ncmp ($ovpnconfig{$a}[1],$ovpnconfig{$b}[1])} keys %ovpnconfig) {
464 if (($ovpnconfig{$dkey}[3] eq 'net') && (-e "/var/run/$ovpnconfig{$dkey}[1]n2n.pid")){
465 $count++;
466 my $tport = $ovpnconfig{$dkey}[22];
467 next if ($tport eq '');
468 my $tnet = new Net::Telnet ( Timeout=>5, Errmode=>'return', Port=>$tport);
469 $tnet->open('127.0.0.1');
470 my @output = $tnet->cmd(String => 'state', Prompt => '/(END.*\n|ERROR:.*\n)/');
471 my @tustate = split(/\,/, $output[1]);
472 my $display;
473 my $display_colour = $Header::colourred;
474 if ( $tustate[1] eq 'CONNECTED' || ($tustate[1] eq 'WAIT')) {
475 $display_colour = $Header::colourgreen;
476 $display = $Lang::tr{'capsopen'};
477 } else {
478 $display = $tustate[1];
479 }
480 if ($count %2){
481 $col = $color{'color22'};
482 }else{
483 $col = $color{'color20'};
484 }
485 $active='off';
486 #make cidr from ip
487 my ($vpnip,$vpnsub) = split("/",$ovpnconfig{$dkey}[11]);
488 my $vpnsub=&General::iporsubtocidr($vpnsub);
489 my $vpnip="$vpnip/$vpnsub";
490 print <<END;
491 <tr>
492 <td style='text-align:left; color:white; background-color:$Header::colourovpn;'>$ovpnconfig{$dkey}[1]</td>
493 <td style='text-align:center; background-color:$col'>$vpnip</td>
494 <td style='text-align:center; color:white; background-color:$display_colour' ><b>$display</b></td>
495 </tr>
496END
497 }
498 }
499 }
500 if ($active ne 'off'){
501 print "<tr><td colspan='3' style='text-align:center;'>$Lang::tr{'ovpn no connections'}</td></tr>";
502 }
503 print"</table>";
504 }
505&Header::closebox();
506}
507
508# Fireinfo
509if ( ! -e "/var/ipfire/main/send_profile") {
510 $warnmessage .= "<li><a style='color: white;' href='fireinfo.cgi'>$Lang::tr{'fireinfo please enable'}</a></li>";
511}
512
513# Memory usage warning
514my @free = `/usr/bin/free`;
515$free[1] =~ m/(\d+)/;
516my $mem = $1;
517$free[2] =~ m/(\d+)/;
518my $used = $1;
519my $pct = int 100 * ($mem - $used) / $mem;
520if ($used / $mem > 90) {
521 $warnmessage .= "<li>$Lang::tr{'high memory usage'}: $pct% !</li>";
522}
523
524# Diskspace usage warning
525my @temp=();
526my $temp2=();
527my @df = `/bin/df -B M -P -x rootfs`;
528foreach my $line (@df) {
529 next if $line =~ m/^Filesystem/;
530 if ($line =~ m/root/ ) {
531 $line =~ m/^.* (\d+)M.*$/;
532 @temp = split(/ +/,$line);
533 if ($1<5) {
534 # available:plain value in MB, and not %used as 10% is too much to waste on small disk
535 # and root size should not vary during time
536 $warnmessage .= "<li>$Lang::tr{'filesystem full'}: $temp[0] <b>$Lang::tr{'free'}=$1M</b> !</li>";
537 }
538
539 } else {
540 # $line =~ m/^.* (\d+)m.*$/;
541 $line =~ m/^.* (\d+)\%.*$/;
542 if ($1>90) {
543 @temp = split(/ /,$line);
544 $temp2=int(100-$1);
545 $warnmessage .= "<li>$Lang::tr{'filesystem full'}: $temp[0] <b>$Lang::tr{'free'}=$temp2%</b> !</li>";
546 }
547 }
548}
549
550# S.M.A.R.T. health warning
551my @files = `/bin/ls /var/run/smartctl_out_hddtemp-* 2>/dev/null`;
552foreach my $file (@files) {
553 chomp ($file);
554 my $disk=`echo $file | cut -d"-" -f2`;
555 chomp ($disk);
556 if (`/bin/grep "SAVE ALL DATA" $file`) {
557 $warnmessage .= "<li>$Lang::tr{'smartwarn1'} /dev/$disk $Lang::tr{'smartwarn2'} !</li>";
558 }
559}
560
561# Reiser4 warning
562my @files = `mount | grep " reiser4 (" 2>/dev/null`;
563foreach my $disk (@files) {
564 chomp ($disk);
565 $warnmessage .= "<li>$disk - $Lang::tr{'deprecated fs warn'}</li>";
566}
567
568if ($warnmessage) {
569 &Header::openbox('100%','center', );
570 print "<table class='tbl' style='width:80%;'>";
571 print "<tr><th>$Lang::tr{'fwhost hint'}</th></tr>";
572 print "<tr><td style='color:white; background-color:$Header::colourred;'>$warnmessage</td></tr>";
573 print "</table>";
574 &Header::closebox();
575}
576
577&Pakfire::dblist("upgrade", "notice");
578if ( -e "/var/run/need_reboot" ) {
579 print "<div style='text-align:center; color:red;'>";
580 print "<br/><br/>$Lang::tr{'needreboot'}!";
581 print "</div>";
582}
583
584&Header::closebigbox();
585&Header::closepage();
586