From a477d8cdc72ead822f36d31c6a4aca6ec2269ac4 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 27 Apr 2019 15:55:23 +0200 Subject: Removing stray veth links when stopping containers with force. Signed-off-by: Daniel Baumann --- lib/container/stop | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/container/stop b/lib/container/stop index 3a0de2a..350d9e6 100755 --- a/lib/container/stop +++ b/lib/container/stop @@ -255,6 +255,17 @@ esac # Run machinectl ${MODE} ${NAME} +case "${FORCE}" in + true) + VETHS="$(awk -F= '/^network-veth-extra=/ { print $2 }' ${CONFIG}/${NAME}.conf | awk -F: '{ print $1 }')" + + for VETH in ${VETHS} + do + ip link delete ${VETH} > /dev/null 2>&1 || true + done + ;; +esac + # Post hooks for FILE in "${HOOKS}/post-${COMMAND}".* "${HOOKS}/${NAME}.post-${COMMAND}" do -- cgit v1.2.3