Unverified Commit b3124075 authored by Kroese's avatar Kroese Committed by GitHub
Browse files

feat: Refactor QEMU PID variables (#1138)

parent aed909bd
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -10,8 +10,6 @@ API_CMD=6
API_HOST="127.0.0.1:$COM_PORT"

QEMU_TERM=""
QEMU_DIR="/run/shm"
QEMU_PID="$QEMU_DIR/qemu.pid"
QEMU_LOG="$QEMU_DIR/qemu.log"
QEMU_OUT="$QEMU_DIR/qemu.out"
QEMU_END="$QEMU_DIR/qemu.end"
@@ -21,6 +19,7 @@ if [[ "$KVM" == [Nn]* ]]; then
  QEMU_TIMEOUT=$(( QEMU_TIMEOUT*2 ))
fi

rm -f "$QEMU_DIR/qemu.*"
touch "$QEMU_LOG"

_trap() {
+6 −1
Original line number Diff line number Diff line
@@ -91,12 +91,17 @@ fi

# Check system

QEMU_DIR="/run/shm"

if [ ! -d "/dev/shm" ]; then
  error "Directory /dev/shm not found!" && exit 14
else
  [ ! -d "/run/shm" ] && ln -s /dev/shm /run/shm
  [ ! -d "$QEMU_DIR" ] && ln -s /dev/shm "$QEMU_DIR"
fi

QEMU_PID="$QEMU_DIR/qemu.pid"
rm -f "$QEMU_PID"

# Check folder

if [[ "${STORAGE,,}" != "/storage" ]]; then