diff options
author | Karel Kočí <cynerd@email.cz> | 2017-07-24 22:38:18 +0200 |
---|---|---|
committer | Karel Kočí <cynerd@email.cz> | 2017-07-24 22:38:18 +0200 |
commit | da70bfe2b9d4c6f95276c0a0a68f1a0d8b42e5fb (patch) | |
tree | 055dd218f72d3a72edcbdf50d7bcecefb2c08f7d /config | |
parent | 74a8b0e36255b7ce19319f96fd67978f6b7e0674 (diff) | |
download | myconfigs-da70bfe2b9d4c6f95276c0a0a68f1a0d8b42e5fb.tar.gz myconfigs-da70bfe2b9d4c6f95276c0a0a68f1a0d8b42e5fb.tar.bz2 myconfigs-da70bfe2b9d4c6f95276c0a0a68f1a0d8b42e5fb.zip |
On bandwidth accept unknown state
Diffstat (limited to 'config')
-rwxr-xr-x | config/i3blocks/scripts/bandwidth | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/config/i3blocks/scripts/bandwidth b/config/i3blocks/scripts/bandwidth index ba15a27..93023c7 100755 --- a/config/i3blocks/scripts/bandwidth +++ b/config/i3blocks/scripts/bandwidth @@ -19,12 +19,15 @@ INTERFACE=$(ip route | awk '/^default .* (wlp|enp)/ { print $5 ; exit }') # Issue #36 compliant. -if ! [ -e "/sys/class/net/${INTERFACE}/operstate" ] || ! [ "`cat /sys/class/net/${INTERFACE}/operstate`" = "up" ] -then - echo down # full text - echo down # short text - echo \#FF0000 # color - exit 0 +if ! [ -e "/sys/class/net/${INTERFACE}/operstate" ]; then + ST="`cat /sys/class/net/${INTERFACE}/operstate`" + # Note: usb telephone network is reported as unknown state + if [ "$ST" = "up" -o "$ST" = "unknown" ]; then + echo down # full text + echo down # short text + echo \#FF0000 # color + exit 0 + fi fi # path to store the old results in |