Browse Source

fix traffic reading if under 100MB

windows
Florian N 12 years ago
parent
commit
1348cfbdd9
  1. 4
      main/views.py

4
main/views.py

@ -130,11 +130,11 @@ def get_traffic(request):
data = pipe.read().strip().split(':',1)[-1]
pipe.close()
if type(data[0]) is str:
if data == ' 0':
pipe = os.popen("cat /proc/net/dev |" + "grep " + request + "| awk '{print $2, $10}'")
data = pipe.read().strip().split(':',1)[-1]
pipe.close()
else:
data = data.split()
traffic_in = int(data[0])

Loading…
Cancel
Save