]> git.ipfire.org Git - ipfire-2.x.git/blobdiff - html/cgi-bin/iptables.cgi
misc-progs: getipstat: Refactor + extend
[ipfire-2.x.git] / html / cgi-bin / iptables.cgi
index d456375891b5556e1314932b3c5b5ac5e9a9a1fd..f900562d9ee31b387e63e435bdca686be2b08e19 100644 (file)
@@ -44,8 +44,6 @@ my %cgiparams=();
 
 &Header::getcgihash(\%cgiparams);
 
-system('/usr/local/bin/getipstat');
-
 &Header::showhttpheaders();
 &Header::openpage($Lang::tr{'ipts'}, 1, '');
 &Header::openbigbox('100%', 'LEFT');
@@ -84,11 +82,11 @@ print <<END
 END
 ;
 
-# We´ll open the txt files and extract each line, if the line
+# We´ll get iptables output and examine each line, if the line
 # start with an Chain the the name, start- and endline of the
 # chain is extracted into a hash
 
-       open (FILE, '/srv/web/ipfire/html/iptables.txt');
+       open (FILE, '/usr/local/bin/getipstat | ');
        while (<FILE>){
 
                $iplines[$lines] = $_;
@@ -150,8 +148,8 @@ END
        print "</tr>\n";
 
        print "<tr>\n";
-       print "   <td width='0'></td>\n   <td width='35'></td>\n   <td width='35'></td>\n";
-       print "   <td width='130'></td>\n   <td width='30'></td>\n";
+       print "   <td width='0'></td>\n   <td width='60'></td>\n   <td width='60'></td>\n";
+       print "   <td width='150'></td>\n   <td width='30'></td>\n";
        print "   <td width='30'></td>\n   <td width='40'></td>\n";
        print "   <td width='40'></td>\n   <td width='95'></td>\n";
        print "   <td width='95'></td>\n   <td width='260'></td>\n";
@@ -206,11 +204,11 @@ print <<END
 END
 ;
 
-# We´ll open the txt files and extract each line, if the line
+# We´ll get iptables output and examine each line, if the line
 # start with an Chain the the name, start- and endline of the
 # chain is extracted into a hash
 
-       open (FILE, '/srv/web/ipfire/html/iptablesmangle.txt');
+       open (FILE, '/usr/local/bin/getipstat -m | ');
        while (<FILE>){
 
                $ipmlines[$manlines] = $_;
@@ -272,8 +270,8 @@ END
        print "</tr>\n";
 
        print "<tr>\n";
-       print "   <td width='0'></td>\n   <td width='35'></td>\n   <td width='35'></td>\n";
-       print "   <td width='130'></td>\n   <td width='30'></td>\n";
+       print "   <td width='0'></td>\n   <td width='60'></td>\n   <td width='60'></td>\n";
+       print "   <td width='150'></td>\n   <td width='30'></td>\n";
        print "   <td width='30'></td>\n   <td width='40'></td>\n";
        print "   <td width='40'></td>\n   <td width='95'></td>\n";
        print "   <td width='95'></td>\n   <td width='260'></td>\n";
@@ -333,11 +331,11 @@ print <<END
 END
 ;
 
-# We´ll open the txt files and extract each line, if the line
+# We´ll get iptables output and examine each line, if the line
 # start with an Chain the the name, start- and endline of the
 # chain is extracted into a hash
 
-       open (FILE, '/srv/web/ipfire/html/iptablesnat.txt');
+       open (FILE, '/usr/local/bin/getipstat -n | ');
        while (<FILE>){
 
                $ipnatlines[$natlines] = $_;
@@ -399,8 +397,8 @@ END
        print "</tr>\n";
 
        print "<tr>\n";
-       print "   <td width='0'></td>\n   <td width='35'></td>\n   <td width='35'></td>\n";
-       print "   <td width='130'></td>\n   <td width='30'></td>\n";
+       print "   <td width='0'></td>\n   <td width='60'></td>\n   <td width='60'></td>\n";
+       print "   <td width='150'></td>\n   <td width='30'></td>\n";
        print "   <td width='30'></td>\n   <td width='40'></td>\n";
        print "   <td width='40'></td>\n   <td width='95'></td>\n";
        print "   <td width='95'></td>\n   <td width='260'></td>\n";
@@ -433,7 +431,3 @@ print "</table></div><br />";
 &Header::closebox();
 &Header::closebigbox();
 &Header::closepage();
-
-system(rm -f "/srv/web/ipfire/html/iptables.txt");
-system(rm -f "/srv/web/ipfire/html/iptablesmangle.txt");
-system(rm -f "/srv/web/ipfire/html/iptablesnat.txt");