From 23eef14c841b60f50272970e64534c55ffe2db6e Mon Sep 17 00:00:00 2001 From: Marcin Krol Date: Mon, 20 Aug 2018 13:45:04 +0000 Subject: [PATCH] - keep script silent if no slaves --- lib/ifdown-bond | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- 2.46.0