From 7abf79e0a75006b1333f44b1e3e492a615dbe977 Mon Sep 17 00:00:00 2001 From: Derek Smith Date: Sun, 17 Dec 2023 16:50:41 -0500 Subject: [PATCH] Spawn lnplay from image if exists. --- deployment/deploy_vm.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/deployment/deploy_vm.sh b/deployment/deploy_vm.sh index 2ca37b5..136945e 100755 --- a/deployment/deploy_vm.sh +++ b/deployment/deploy_vm.sh @@ -80,9 +80,11 @@ if ! incus list --format csv | grep -q "$INCUS_VM_NAME"; then bash -c "./stub_profile.sh --vm=$VIRTUAL_MACHINE --incus-hostname=$INCUS_VM_NAME --ss-volume-name=$SSDATA_VOLUME_NAME --backup-volume-name=$BACKUP_VOLUME_NAME" - # now let's create a new VM to work with. - #incus init -q --profile="$INCUS_VM_NAME" "$BASE_IMAGE_VM_NAME" "$INCUS_VM_NAME" --vm - incus init "$DOCKER_BASE_IMAGE_NAME" "$INCUS_VM_NAME" --vm --profile="$INCUS_VM_NAME" + if ! incus image list -q --format csv | grep -q "$INCUS_VM_NAME"; then + incus init -q "$DOCKER_BASE_IMAGE_NAME" "$INCUS_VM_NAME" --vm --profile="$INCUS_VM_NAME" + elif [ "$VIRTUAL_MACHINE" = lnplayserver ]; then + incus init -q "$INCUS_VM_NAME" "$INCUS_VM_NAME" --vm --profile="$INCUS_VM_NAME" + fi # let's PIN the HW address for now so we don't exhaust IP # and so we can set DNS internally.