[status] fix: pipe errors to /dev/null if iface is missing

This commit is contained in:
David JULIEN 2022-11-13 01:12:35 +01:00
parent 0c8623b510
commit abf306c99f

View File

@ -18,7 +18,7 @@ case "$state" in
INTERFACE_DISABLED) str="WIFI DOWN" ;; INTERFACE_DISABLED) str="WIFI DOWN" ;;
*) str="$(printf "NO WIFI")";; *) str="$(printf "NO WIFI")";;
esac esac
eth="$(cat /sys/class/net/enp0s31f6/operstate)" eth="$(cat /sys/class/net/enp0s31f6/operstate &> /dev/null)"
if [ "up" = "$eth" ]; then if [ "up" = "$eth" ]; then
str="$(printf "%s / " "$str")" str="$(printf "%s / " "$str")"
fi fi