summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@open-infrastructure.net>2019-04-27 13:53:37 +0000
committerDaniel Baumann <daniel.baumann@open-infrastructure.net>2019-08-11 08:48:22 +0000
commit0206529e4be9ff8df0511133e13f71c943de2172 (patch)
tree8ca64b11912ccec79d2aede89ab46c741791b3bf /lib
parentUpdating interfaces example configuration in host-setup documentation. (diff)
downloadcompute-tools-0206529e4be9ff8df0511133e13f71c943de2172.tar.xz
compute-tools-0206529e4be9ff8df0511133e13f71c943de2172.zip
Removing stray veth links when starting containers with force.
Signed-off-by: Daniel Baumann <daniel.baumann@open-infrastructure.net>
Diffstat (limited to '')
-rwxr-xr-xlib/container/start7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/container/start b/lib/container/start
index d5e9059..47c2907 100755
--- a/lib/container/start
+++ b/lib/container/start
@@ -144,6 +144,13 @@ then
case "${FORCE}" in
true)
rm -f "${MACHINES}/.#${NAME}.lck"
+
+ 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
;;
*)