From 2ff5b204e592e7b7d5c49c32c5574827e6a8d627 Mon Sep 17 00:00:00 2001 From: Florian N Date: Sun, 16 Feb 2014 16:24:44 -0500 Subject: [PATCH] Arch linux support --- main/views.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main/views.py b/main/views.py index b2dddad..cf9ad72 100755 --- a/main/views.py +++ b/main/views.py @@ -142,7 +142,7 @@ def get_traffic(request): data = pipe.read().strip().split(':',1)[-1] pipe.close() - if data == ' 0': + if not data[0].isdigit(): pipe = os.popen("cat /proc/net/dev |" + "grep " + request + "| awk '{print $2, $10}'") data = pipe.read().strip().split(':',1)[-1] pipe.close() @@ -169,6 +169,9 @@ def get_platform(): osname = " ".join(platform.linux_distribution()) uname = platform.uname() + if osname == ' ' + osname = uname[0] + data = {'osname': osname, 'hostname': uname[1], 'kernel': uname[2] } except Exception,err: