X-Git-Url: http://git.ipfire.org/?p=people%2Fteissler%2Fipfire-2.x.git;a=blobdiff_plain;f=html%2Fcgi-bin%2Findex.cgi;h=01bb3d6850c13f25f5de12f6f8c94b348ed69353;hp=0dcadb0b2223de184030087642135b1a189c7b5c;hb=c78993cdde0391d1336797dd4368b41794a40487;hpb=08abf73d0e2be7fc77b93e26b3700b6aa8af3678 diff --git a/html/cgi-bin/index.cgi b/html/cgi-bin/index.cgi index 0dcadb0b2..01bb3d685 100644 --- a/html/cgi-bin/index.cgi +++ b/html/cgi-bin/index.cgi @@ -2,7 +2,7 @@ ############################################################################### # # # IPFire.org - A linux based firewall # -# Copyright (C) 2007-2011 IPFire Team # +# Copyright (C) 2007-2012 IPFire Team # # # # 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 # @@ -20,6 +20,7 @@ ############################################################################### use strict; +use Net::Telnet; # enable only the following on debugging purpose #use warnings; @@ -355,7 +356,7 @@ END END my $id = 0; my $gif; - foreach my $key (keys %confighash) { + foreach my $key (sort { uc($confighash{$a}[1]) cmp uc($confighash{$b}[1]) } keys %confighash) { if ($confighash{$key}[0] eq 'on') { $gif = 'on.gif'; } else { $gif = 'off.gif'; } if ($id % 2) { @@ -369,7 +370,9 @@ END $active = "
$Lang::tr{'capsclosed'}
"; } else { foreach my $line (@status) { - if ($line =~ /\"$confighash{$key}[1]\".*IPsec SA established/) { + if (($line =~ /\"$confighash{$key}[1]\".*IPsec SA established/) || + ($line =~/$confighash{$key}[1]\{.*INSTALLED/ )) + { $active = "
$Lang::tr{'capsopen'}
"; } } @@ -385,9 +388,54 @@ END OpenVPN
$ovpnip Online + END + } +### +# m.a.d n2n +### + +if ( -d "${General::swroot}/ovpn/n2nconf") { +my %confighash=(); +my $display = ''; + +&General::readhasharray("${General::swroot}/ovpn/ovpnconfig", \%confighash); +foreach my $dkey (keys %confighash) { +if ($confighash{$dkey}[3] eq 'net') { + + + if (-e "/var/run/$confighash{$dkey}[1]n2n.pid") { + my @output = ""; + my @tustate = ""; + my $tport = $confighash{$dkey}[22]; + my $tnet = new Net::Telnet ( Timeout=>5, Errmode=>'return', Port=>$tport); + if ($tport ne '') { + $tnet->open('127.0.0.1'); + @output = $tnet->cmd(String => 'state', Prompt => '/(END.*\n|ERROR:.*\n)/'); + @tustate = split(/\,/, $output[1]); + if ( $tustate[1] eq 'CONNECTED') + { $display = "$Lang::tr{'capsopen'}"; + } else { + $display = "$tustate[1]"; } + + print <OpenVPN n2n
+ $confighash{$dkey}[10] $display + +END +; +} +} +} +} +} + +### +# m.a.d n2n end +### + # Fireinfo if ( ! -e "/var/ipfire/main/send_profile") { $warnmessage .= "
  • $Lang::tr{'fireinfo please enable'}
  • "; @@ -441,6 +489,14 @@ foreach my $file (@files) { } } +# Reiser4 warning +my @files = `mount | grep " reiser4 (" 2>/dev/null`; +foreach my $disk (@files) { + chomp ($disk); + $warnmessage .= "
  • $disk - $Lang::tr{'deprecated fs warn'}
  • \n\n"; +} + + if ($warnmessage) { print "$warnmessage"; }