fix: the VM's ssh key is looked up at every call (a clean host failed the first-boot check: common.sh was sourced before the key existed)
Sync git.upriser.nl mirror / sync (push) Skipped

This commit is contained in:
theupriser committed 2026-09-30 09:43:05 +02:00
1 parent fafa38fbb4
commit 092e888c3f
2 files changed
+10 -3

No files matched your search

+1 -1
View File
@@ -39,7 +39,7 @@ running() { pgrep -f "[h]ostfwd=tcp::$VM_PORT-" >/dev/null; }
stop_vm() {
running || return 0
# Whichever VM runs: its key and host key are not this VM's.
ssh -p "$VM_PORT" -i "$VM_SSH_KEY" -o BatchMode=yes -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o LogLevel=ERROR \
ssh -p "$VM_PORT" -i "$(vm_key)" -o BatchMode=yes -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o LogLevel=ERROR \
"$VM_USER@$VM_HOST" 'sudo systemctl poweroff' >/dev/null 2>&1
local _; for _ in $(seq 30); do running || return 0; sleep 2; done
pkill -f "[h]ostfwd=tcp::$VM_PORT-"; sleep 2