diff --git a/create_lxc_base.sh b/create_lxc_base.sh index ca48938..6d1b1ad 100755 --- a/create_lxc_base.sh +++ b/create_lxc_base.sh @@ -5,6 +5,10 @@ cd "$(dirname "$0")" bash -c "./stub_lxc_profile.sh --lxd-hostname=$BASE_IMAGE_VM_NAME" +if lxc list -q --project default | grep -q "$BASE_IMAGE_VM_NAME" ; then + lxc delete -f "$BASE_IMAGE_VM_NAME" --project=default +fi + # let's download our base image. if ! lxc image list --format csv --columns l | grep -q "$UBUNTU_BASE_IMAGE_NAME"; then # if the image if cached locally, import it from disk, otherwise download it from ubuntu