From ae88de13caaa06f8c614ae6e90800f715b2738b1 Mon Sep 17 00:00:00 2001 From: Ermal Date: Tue, 19 Feb 2013 21:46:47 +0000 Subject: Some more code cleanup --- usr/local/www/bandwidth_by_ip.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'usr/local') diff --git a/usr/local/www/bandwidth_by_ip.php b/usr/local/www/bandwidth_by_ip.php index 002d17d..5c46912 100755 --- a/usr/local/www/bandwidth_by_ip.php +++ b/usr/local/www/bandwidth_by_ip.php @@ -35,10 +35,7 @@ if ($sort == "out") else {$sort_method = "-R";} -exec("/usr/local/bin/rate -i {$real_interface} -nlq 1 -Aba 20 {$sort_method} -c {$intsubnet} | tr \"|\" \" \" | awk '{ printf \"%s:%s:%s:%s:%s\\n\", $1, $2, $4, $6, $8 }'", $listedIPs); -unset($bandwidthinfo); -unset($receivebytesarray); -unset($transmitbytesarray); +$_grb = exec("/usr/local/bin/rate -i {$real_interface} -nlq 1 -Aba 20 {$sort_method} -c {$intsubnet} | tr \"|\" \" \" | awk '{ printf \"%s:%s:%s:%s:%s\\n\", $1, $2, $4, $6, $8 }'", $listedIPs); $someinfo = false; for ($x=2; $x<12; $x++){ @@ -56,6 +53,8 @@ for ($x=2; $x<12; $x++){ $someinfo = true; } } +unset($bandwidthinfo, $_grb); +unset($listedIPs); //no bandwidth usage found if ($someinfo == false) -- cgit v1.1