Merge pull request #90 from BarbarossaTM/chore/link-executor

Clean up link executor
This commit is contained in:
Maximilian Wilhelm 2020-10-02 03:09:14 +02:00 committed by GitHub
commit 98ac007ffe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -36,6 +36,8 @@ create)
echo "Interface ${IFACE} exists but is of type ${iface_type} instead of dummy"
exit 1
fi
exit 0
fi
${MOCK} ip link add "${IFACE}" type dummy
@ -74,6 +76,11 @@ up)
fi
;;
down)
# Don't complain about a vanished interface when downing it
if [ -z "${MOCK}" -a ! -d "/sys/class/net/${IFACE}" ]; then
exit 0
fi
${MOCK} ip link set down dev "${IFACE}"
;;
destroy)