aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManuel Palenzuela <manuelpalenzuelamerino@gmail.com>2019-10-26 02:26:33 +0100
committerManuel Palenzuela <manuelpalenzuelamerino@gmail.com>2019-10-26 02:26:33 +0100
commit3562a69c232437d77f316145a95e2844882f9c74 (patch)
treedec911ccf5335cf3df089adca207953e72c2a9f2
parent4be623eec5b48079486341609dd5fa9cbd58ea52 (diff)
Fixed networkup/down bug (crazy num)
-rw-r--r--TODO.org2
-rwxr-xr-xmodules/networkdowntraffic2
-rwxr-xr-xmodules/networkuptraffic2
3 files changed, 3 insertions, 3 deletions
diff --git a/TODO.org b/TODO.org
index 32e5212..395c5d0 100644
--- a/TODO.org
+++ b/TODO.org
@@ -14,7 +14,7 @@ Each module writes to stdout.
- Add dependencies like bc
Bugs to fix:
-- Fix networkup/down crazy values
+none
Modules to Write:
- We are more than welcome to accept ideas and pull requests for future
diff --git a/modules/networkdowntraffic b/modules/networkdowntraffic
index d272503..e8d3a74 100755
--- a/modules/networkdowntraffic
+++ b/modules/networkdowntraffic
@@ -12,7 +12,7 @@ get_down_traffic()
IFACES=$(ip -o link show | awk -F': ' '{print $2}')
for IFACE in $IFACES; do
if [ $IFACE != "lo" ]; then
- RECIEVE1=$(($(ip -s -c link show wlan0 | tail -n3 | head -n 1 | cut -d " " -f5) + $RECIEVE1))
+ RECIEVE1=$(($(ip -s -c link show $IFACE | tail -n3 | head -n 1 | cut -d " " -f5) + $RECIEVE1))
fi
done
diff --git a/modules/networkuptraffic b/modules/networkuptraffic
index b1db633..396e969 100755
--- a/modules/networkuptraffic
+++ b/modules/networkuptraffic
@@ -12,7 +12,7 @@ get_up_traffic()
IFACES=$(ip -o link show | awk -F': ' '{print $2}')
for IFACE in $IFACES; do
if [ $IFACE != "lo" ]; then
- TRANSMIT1=$(($(ip -s -c link show wlan0 | tail -n1 | cut -d " " -f5) + TRANSMIT1))
+ TRANSMIT1=$(($(ip -s -c link show $IFACE | tail -n1 | cut -d " " -f5) + TRANSMIT1))
fi
done