Files
eco_os/isotest/stop.sh
2026-01-08 12:28:54 +00:00

18 lines
411 B
Bash
Executable File

#!/bin/bash
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
if [ -f "$SCRIPT_DIR/qemu.pid" ]; then
PID=$(cat "$SCRIPT_DIR/qemu.pid")
if kill -0 "$PID" 2>/dev/null; then
echo "Stopping QEMU (PID: $PID)..."
kill "$PID"
sleep 1
fi
rm -f "$SCRIPT_DIR/qemu.pid"
rm -f "$SCRIPT_DIR/qemu-monitor.sock"
echo "QEMU stopped"
else
echo "QEMU not running (no PID file)"
fi