Changed units in networkup/down modules

This commit is contained in:
Manuel Palenzuela 2019-10-25 12:39:51 +01:00
parent 21d96d4758
commit fe7633cd1b
3 changed files with 4 additions and 8 deletions

View file

@ -12,8 +12,6 @@ Each module writes to stdout.
* Todo List
- Delay in archupdates module (if minutes divisible by 5/4)
- Add dependencies like bc
- Networkup/down modules in kb instead of mb? and change sleep to 1s so that
output is XMb/s
Bugs to fix:
None

View file

@ -6,7 +6,6 @@ PREFIX=' '
get_down_traffic()
{
DELTA=2
RECIEVE1=0
RECIEVE2=0
@ -17,7 +16,7 @@ get_down_traffic()
fi
done
sleep $DELTA
sleep 1
IFACES=$(ip -o link show | awk -F': ' '{print $2}')
for IFACE in $IFACES; do
@ -26,7 +25,7 @@ get_down_traffic()
fi
done
echo "$PREFIX$(expr $(expr $RECIEVE2 - $RECIEVE1 ) / 1000000)MB"
echo "$PREFIX$(expr $(expr $RECIEVE2 - $RECIEVE1 ) / 1000)KB/s"
}
get_down_traffic

View file

@ -6,7 +6,6 @@ PREFIX=' '
get_up_traffic()
{
DELTA=2
TRANSMIT1=0
TRANSMIT2=0
@ -17,7 +16,7 @@ get_up_traffic()
fi
done
sleep $DELTA
sleep 1
IFACES=$(ip -o link show | awk -F': ' '{print $2}')
for IFACE in $IFACES; do
@ -26,7 +25,7 @@ get_up_traffic()
fi
done
echo "$PREFIX$(expr $(expr $TRANSMIT2 - $TRANSMIT1) / 1000000)MB"
echo "$PREFIX$(expr $(expr $TRANSMIT2 - $TRANSMIT1) / 1000)KB/s"
}
get_up_traffic