aboutsummaryrefslogtreecommitdiff
path: root/config/i3blocks/scripts/bandwidth
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2017-08-27 13:33:11 +0200
committerKarel Kočí <cynerd@email.cz>2017-08-27 13:33:11 +0200
commit390e78655fd11144aa9b3f019b4b6a9ad2690474 (patch)
treedaa7a58387b5aa925da12efc4b55ec0cfc9b0805 /config/i3blocks/scripts/bandwidth
parentb2cae196d9bfef3a556db0147014c60ec09ebe5c (diff)
downloadmyconfigs-390e78655fd11144aa9b3f019b4b6a9ad2690474.tar.gz
myconfigs-390e78655fd11144aa9b3f019b4b6a9ad2690474.tar.bz2
myconfigs-390e78655fd11144aa9b3f019b4b6a9ad2690474.zip
Revert "On bandwidth accept unknown state"
This reverts commit da70bfe2b9d4c6f95276c0a0a68f1a0d8b42e5fb.
Diffstat (limited to 'config/i3blocks/scripts/bandwidth')
-rwxr-xr-xconfig/i3blocks/scripts/bandwidth15
1 files changed, 6 insertions, 9 deletions
diff --git a/config/i3blocks/scripts/bandwidth b/config/i3blocks/scripts/bandwidth
index 93023c7..ba15a27 100755
--- a/config/i3blocks/scripts/bandwidth
+++ b/config/i3blocks/scripts/bandwidth
@@ -19,15 +19,12 @@
INTERFACE=$(ip route | awk '/^default .* (wlp|enp)/ { print $5 ; exit }')
# Issue #36 compliant.
-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
+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
fi
# path to store the old results in