link executor: switch back to up/down phase
This commit is contained in:
parent
b311293c6b
commit
6c7c3f570d
1 changed files with 6 additions and 8 deletions
|
@ -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)
|
||||||
|
|
Loading…
Reference in a new issue