initial
This commit is contained in:
21
isotest/stop.sh
Executable file
21
isotest/stop.sh
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||
PROJECT_ROOT="$SCRIPT_DIR/.."
|
||||
VM_DIR="$PROJECT_ROOT/.nogit/vm"
|
||||
PID_FILE="$VM_DIR/qemu.pid"
|
||||
|
||||
if [ -f "$PID_FILE" ]; then
|
||||
PID=$(cat "$PID_FILE")
|
||||
if kill -0 "$PID" 2>/dev/null; then
|
||||
echo "Stopping QEMU (PID: $PID)..."
|
||||
kill "$PID"
|
||||
sleep 1
|
||||
fi
|
||||
rm -f "$PID_FILE"
|
||||
rm -f "$VM_DIR/qemu-monitor.sock"
|
||||
rm -f "$VM_DIR/serial.sock"
|
||||
echo "QEMU stopped"
|
||||
else
|
||||
echo "QEMU not running (no PID file)"
|
||||
fi
|
||||
Reference in New Issue
Block a user