From fb03d3edea984eda49f0ea1715b8fb5ef6ffc980 Mon Sep 17 00:00:00 2001 From: Kay0u Date: Mon, 22 May 2023 12:57:17 +0200 Subject: [PATCH] force remove mac address after restoring snapshot --- prepare.sh | 3 +++ utils.sh | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/prepare.sh b/prepare.sh index 42e2525..8611366 100755 --- a/prepare.sh +++ b/prepare.sh @@ -30,6 +30,9 @@ start_container () { restore_snapshot "$CONTAINER_IMAGE" "$CURRENT_VERSION" "$SNAPSHOT_NAME" + # Unset the mac address to ensure the copy will get a new one and will be able to get new IP + lxc config unset "$CONTAINER_IMAGE" volatile.eth0.hwaddr 2> /dev/null + lxc start $CONTAINER_IMAGE wait_container $CONTAINER_IMAGE diff --git a/utils.sh b/utils.sh index 298e26e..0d7f55a 100755 --- a/utils.sh +++ b/utils.sh @@ -98,9 +98,6 @@ create_snapshot() local ynh_version=$2 local snapshot=$3 - # Unset the mac address to ensure the copy will get a new one and will be able to get new IP - lxc config unset "$image_to_rebuild" volatile.eth0.hwaddr 2> /dev/null - # Create snapshot lxc snapshot "$instance_to_publish" "$ynh_version-$snapshot" --reuse }