From 4be623eec5b48079486341609dd5fa9cbd58ea52 Mon Sep 17 00:00:00 2001 From: Manuel Palenzuela Date: Fri, 25 Oct 2019 14:07:33 +0100 Subject: [PATCH] Fixed networkup/down but new bug now --- TODO.org | 3 +-- modules/networkdowntraffic | 2 +- modules/networkuptraffic | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/TODO.org b/TODO.org index 825a3bf..32e5212 100644 --- a/TODO.org +++ b/TODO.org @@ -12,10 +12,9 @@ Each module writes to stdout. * Todo List - Delay in archupdates module (if minutes divisible by 5/4) - Add dependencies like bc -- Add hostname module Bugs to fix: -None +- Fix networkup/down crazy values 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 f1b5584..d272503 100755 --- a/modules/networkdowntraffic +++ b/modules/networkdowntraffic @@ -21,7 +21,7 @@ get_down_traffic() IFACES=$(ip -o link show | awk -F': ' '{print $2}') for IFACE in $IFACES; do if [ $IFACE != "lo" ]; then - RECIEVE2=$(($(ip -s -c link show wlan0 | tail -n3 | head -n 1 | cut -d " " -f5) + $RECIEVE2)) + RECIEVE2=$(($(ip -s -c link show $IFACE | tail -n3 | head -n 1 | cut -d " " -f5) + $RECIEVE2)) fi done diff --git a/modules/networkuptraffic b/modules/networkuptraffic index 6b002e6..b1db633 100755 --- a/modules/networkuptraffic +++ b/modules/networkuptraffic @@ -21,7 +21,7 @@ get_up_traffic() IFACES=$(ip -o link show | awk -F': ' '{print $2}') for IFACE in $IFACES; do if [ $IFACE != "lo" ]; then - TRANSMIT2=$(($(ip -s -c link show wlan0 | tail -n1 | cut -d " " -f5) + TRANSMIT2)) + TRANSMIT2=$(($(ip -s -c link show $IFACE | tail -n1 | cut -d " " -f5) + TRANSMIT2)) fi done