Cosmetical
Suppress warnings like: RX yesterday: eth0+eth1+wlan0+wlan1: Not enough data available yet.
This commit is contained in:
parent
5bdf27b876
commit
dc0cebe3d2
@ -234,6 +234,7 @@ if [[ $(command -v vnstat) ]]; then
|
||||
traffic=$(vnstat -d 1 -i $PRIMARY_INTERFACE --oneline | cut -d";" -f4,5)
|
||||
traffic_rx=$(echo $traffic | cut -d";" -f1,1 | sed -r 's/([0-9]+\.[0-9]{1})[0-9]*/\1/')
|
||||
traffic_tx=$(echo $traffic | cut -d";" -f2,2 | sed -r 's/([0-9]+\.[0-9]{1})[0-9]*/\1/')
|
||||
[[ "$traffic" == *"Not enough"* ]] && traffic_tx="n/a "; traffic_rx="n/a "
|
||||
printf "${PRIMARY_DIRECTION^^} yesterday: "
|
||||
if [[ $PRIMARY_DIRECTION == tx ]]; then
|
||||
printf "\x1B[92m%s\x1B[0m" "$traffic_tx"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user