Ignore /sys/classa/net/$iface/carrier access errors
authorSiraaj Khandkar <siraaj@khandkar.net>
Wed, 6 Mar 2019 19:43:22 +0000 (14:43 -0500)
committerSiraaj Khandkar <siraaj@khandkar.net>
Wed, 6 Mar 2019 19:43:22 +0000 (14:43 -0500)
which begin when interface is disabled.

x2/src/bash/exe/khatus_sensor_net_carrier.sh

index 38597d0..3d463d6 100644 (file)
@@ -2,5 +2,5 @@
 
 for interface in $(ls /sys/class/net)
 do
-    printf "%s|%d\n" $interface $(cat /sys/class/net/$interface/carrier)
+    printf "%s|%d\n" $interface $(cat /sys/class/net/$interface/carrier 2> /dev/null)
 done
This page took 0.027259 seconds and 4 git commands to generate.