From 6c7c3f570d35844fb2ef844d8bf4024b95c7431f Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Tue, 25 Aug 2020 08:14:55 -0600 Subject: [PATCH] link executor: switch back to up/down phase --- executor-scripts/linux/link | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/executor-scripts/linux/link b/executor-scripts/linux/link index 2aa78f9..f7ede1f 100755 --- a/executor-scripts/linux/link +++ b/executor-scripts/linux/link @@ -29,14 +29,12 @@ is_vlan() { } case "$PHASE" in -pre-up|post-down) - UP_DOWN="${PHASE##*-}" - +up|down) if is_vlan; then ADD_DEL="add" - [ "$UP_DOWN" = "down" ] && ADD_DEL="delete" + [ "$PHASE" = "down" ] && ADD_DEL="delete" - if [ "$UP_DOWN" = "up" -a -e /sys/class/net/$IFACE ]; then + if [ "$PHASE" = "up" -a -e /sys/class/net/$IFACE ]; then exit 0 fi @@ -53,11 +51,11 @@ pre-up|post-down) fi ${MOCK} ip link $ADD_DEL link "$IF_VLAN_RAW_DEVICE" name "$IFACE" type vlan id "$IF_VLAN_ID" - [ "$UP_DOWN" = "down" ] && exit 0 + [ "$PHASE" = "down" ] && exit 0 - ${MOCK} ip link set $UP_DOWN dev $IFACE $IF_LINK_OPTIONS + ${MOCK} ip link set $PHASE dev $IFACE $IF_LINK_OPTIONS else - ${MOCK} ip link set $UP_DOWN dev $IFACE $IF_LINK_OPTIONS + ${MOCK} ip link set $PHASE dev $IFACE $IF_LINK_OPTIONS fi ;; depend)