remove mac address each time we create a new snapshot

This commit is contained in:
Kay0u 2023-05-22 12:42:37 +02:00
parent e2bf59539b
commit 33a8934c0d
No known key found for this signature in database
GPG key ID: AAFEEB16CFA2AE2D

View file

@ -98,6 +98,9 @@ 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
}
@ -206,9 +209,6 @@ rebuild_base_containers()
chmod 777 $current_dir/cache
lxc config device add "$image_to_rebuild" cache-folder disk path=/cache source="$current_dir/cache"
# 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
create_snapshot "$image_to_rebuild" "$ynh_version" "before-install"
# Install YunoHost