link executor: Make vlan disposal MOCKable again

Signed-off-by: Maximilian Wilhelm <max@sdn.clinic>
This commit is contained in:
Maximilian Wilhelm 2020-09-05 00:15:01 +02:00
parent 58f010fe91
commit 37a7d8f097

View file

@ -77,10 +77,12 @@ down)
${MOCK} ip link set down dev "${IFACE}" ${MOCK} ip link set down dev "${IFACE}"
;; ;;
post-down) post-down)
if [ "${IF_LINK_TYPE}" = "dummy" -o is_vlan ]; then if [ "${IF_LINK_TYPE}" = "dummy" ] || is_vlan; then
if [ -d "/sys/class/net/${IFACE}" ]; then if [ -z "${MOCK}" -a ! -d "/sys/class/net/${IFACE}" ]; then
ip link del "${IFACE}" exit 0
fi fi
ip link del "${IFACE}"
fi fi
;; ;;
depend) depend)