link executor: switch back to up/down phase

This commit is contained in:
Ariadne Conill 2020-08-25 08:14:55 -06:00
parent b311293c6b
commit 6c7c3f570d

View file

@ -29,14 +29,12 @@ is_vlan() {
} }
case "$PHASE" in case "$PHASE" in
pre-up|post-down) up|down)
UP_DOWN="${PHASE##*-}"
if is_vlan; then if is_vlan; then
ADD_DEL="add" 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 exit 0
fi fi
@ -53,11 +51,11 @@ pre-up|post-down)
fi fi
${MOCK} ip link $ADD_DEL link "$IF_VLAN_RAW_DEVICE" name "$IFACE" type vlan id "$IF_VLAN_ID" ${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 else
${MOCK} ip link set $UP_DOWN dev $IFACE $IF_LINK_OPTIONS ${MOCK} ip link set $PHASE dev $IFACE $IF_LINK_OPTIONS
fi fi
;; ;;
depend) depend)