]> TLD Linux GIT Repositories - rc-scripts.git/commitdiff
- keep script silent if no slaves
authorMarcin Krol <hawk@tld-linux.org>
Mon, 20 Aug 2018 13:45:04 +0000 (13:45 +0000)
committerMarcin Krol <hawk@tld-linux.org>
Mon, 20 Aug 2018 13:45:04 +0000 (13:45 +0000)
lib/ifdown-bond

index 1d81ecb548e88f0432e0c6b29a619df6810211ef..80a2cf224bafca00943e19a922447421d52af817 100755 (executable)
@@ -38,7 +38,7 @@ setup_ip_param
 LC_ALL=C ip addr flush dev ${DEVICE} 2>&1 | grep -v "Nothing to flush"
 
 # release slave devices
-for SLAVE_DEV in $(cat /sys/class/net/${DEVICE}/bonding/slaves); do
+for SLAVE_DEV in $(cat /sys/class/net/${DEVICE}/bonding/slaves 2>/dev/null); do
        echo "-${SLAVE_DEV}" > /sys/class/net/${DEVICE}/bonding/slaves
 done