fix: vmreset.sh works when the VM lives in the repo itself (cp of run.sh onto itself failed)

This commit is contained in:
theupriser committed 2026-09-28 18:27:27 +02:00
1 parent 7db82b6494
commit 0ae7cce488
1 file changed
+1 -1
+1 -1
View File
@@ -23,7 +23,7 @@ fi
echo "Restoring snapshot '$SNAPSHOT' in $VM_DIR..." echo "Restoring snapshot '$SNAPSHOT' in $VM_DIR..."
cd "$VM_DIR" cd "$VM_DIR"
# Always this repo's run.sh: a copy in $VM_DIR falls behind (VM_CACHE, ...). # Always this repo's run.sh: a copy in $VM_DIR falls behind (VM_CACHE, ...).
cp "$repo_dir/run.sh" run.sh [[ "$repo_dir/run.sh" -ef run.sh ]] || cp "$repo_dir/run.sh" run.sh
qemu-img snapshot -a "$SNAPSHOT" disk.qcow2 qemu-img snapshot -a "$SNAPSHOT" disk.qcow2
cp "vars.$SNAPSHOT.fd" vars.fd cp "vars.$SNAPSHOT.fd" vars.fd