]> git.ipfire.org Git - ipfire-2.x.git/blobdiff - html/cgi-bin/guardian.cgi
Merge branch 'next'
[ipfire-2.x.git] / html / cgi-bin / guardian.cgi
index fb16be00e9a27e2f99f42aa14bc50b4ca0f02a69..552c672111eae198d5f1cc15a29c52b256d91aac 100644 (file)
@@ -829,12 +829,9 @@ sub GetBlockedHosts() {
        my @hosts;
 
        # Launch helper to get chains from iptables.
-       system('/usr/local/bin/getipstat');
+       open (FILE, '/usr/local/bin/getipstat | ');
 
-       # Open temporary file which contains the chains and rules.
-       open (FILE, '/var/tmp/iptables.txt');
-
-       # Loop through the entire file.
+       # Loop through the entire output.
        while (<FILE>) {
                my $line = $_;
 
@@ -864,11 +861,6 @@ sub GetBlockedHosts() {
        # Close filehandle.
        close(FILE);
 
-       # Remove recently created temporary files of the "getipstat" binary.
-       system("rm -f /var/tmp/iptables.txt");
-       system("rm -f /var/tmp/iptablesmangle.txt");
-       system("rm -f /var/tmp/iptablesnat.txt");
-
        # Convert entries, sort them, write back and store the sorted entries into new array.
        my @sorted = map  { $_->[0] }
              sort { $a->[1] <=> $b->[1] }