]> git.ipfire.org Git - ipfire-2.x.git/blobdiff - html/cgi-bin/traffic.cgi
kernel: update to 4.9.34
[ipfire-2.x.git] / html / cgi-bin / traffic.cgi
index 0fff97ca89b3e8156403e7743e686e5fb4635c51..fbffecb7cc2082138ff43844dd2c5b71c6715fac 100644 (file)
@@ -2,7 +2,7 @@
 ###############################################################################
 #                                                                             #
 # IPFire.org - A linux based firewall                                         #
-# Copyright (C) 2007  Michael Tremer & Christian Schmidt                      #
+# Copyright (C) 2007-2014  IPFire Team  <info@ipfire.org>                     #
 #                                                                             #
 # 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        #
@@ -28,8 +28,6 @@ use strict;
 require '/var/ipfire/general-functions.pl';
 require "${General::swroot}/lang.pl";
 require "${General::swroot}/header.pl";
-require "${General::swroot}/net-traffic/net-traffic-admin.pl";
-require "${General::swroot}/net-traffic/net-traffic-lib.pl";
 
 my %color = ();
 my %mainsettings = ();
@@ -83,9 +81,11 @@ sub display_vnstat
 {
        my $device = $_[0];
 
-       my $testdata = `/usr/bin/vnstat -i $device | grep "enough data"`;
+       my $testdata = `/usr/bin/vnstat -i $device`;
 
-       if (! $testdata) {
+       if ( $testdata =~ 'enough') {
+               print"No data for $device !<br>";
+       } else {
            system("/usr/bin/vnstati -c 5 -s -i $device -o /srv/web/ipfire/html/graphs/vnstat-s-$device.png");
            # Hour graph
            system("/usr/bin/vnstati -c 5 -h -i $device -o /srv/web/ipfire/html/graphs/vnstat-h-$device.png");
@@ -107,8 +107,6 @@ print <<END
 </table>
 END
 ;
-           } else {
-               print"No data for $device !<br>";
            }
        print"<hr>";
 }