diff options
Diffstat (limited to 'templates/interfaces/bonding/node.def')
-rw-r--r-- | templates/interfaces/bonding/node.def | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/templates/interfaces/bonding/node.def b/templates/interfaces/bonding/node.def index d87d5b98..1fa270b4 100644 --- a/templates/interfaces/bonding/node.def +++ b/templates/interfaces/bonding/node.def @@ -22,8 +22,14 @@ delete: SLAVES=`cat /sys/class/net/$VAR(@)/bonding/slaves`; exit 1; fi -end: if [ -f /tmp/bonding_$VAR(@).$PPID ] - then rm -f /tmp/bonding_$VAR(@).$PPID - sudo ip link set "$VAR(@)" up - /opt/vyatta/sbin/vyatta-link-detect $VAR(@) on - fi +end: `/bin/cli-shell-api exists interfaces bonding $VAR(@) disable` + if [ $? -ne 0 ] + then + if [ -f /tmp/bonding_$VAR(@).$PPID ] + then rm -f /tmp/bonding_$VAR(@).$PPID + sudo ip link set "$VAR(@)" up + /opt/vyatta/sbin/vyatta-link-detect $VAR(@) on + fi + else + sudo ip link set "$VAR(@)" down + fi |