From: Marcin Krol Date: Mon, 20 Aug 2018 13:45:04 +0000 (+0000) Subject: - keep script silent if no slaves X-Git-Tag: 0.5.2~3 X-Git-Url: https://git.tld-linux.org/?a=commitdiff_plain;h=23eef14c841b60f50272970e64534c55ffe2db6e;p=rc-scripts.git - keep script silent if no slaves --- diff --git a/lib/ifdown-bond b/lib/ifdown-bond index 1d81ecb..80a2cf2 100755 --- a/lib/ifdown-bond +++ b/lib/ifdown-bond @@ -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