mirror of
https://github.com/hectorm/docker-qemu-reactos
synced 2025-01-08 01:55:30 +00:00
18 lines
378 B
Bash
Executable File
18 lines
378 B
Bash
Executable File
#!/bin/sh
|
|
|
|
set -eu
|
|
|
|
stop() {
|
|
for s in "${SVDIR:?}"/*; do sv force-stop "${s:?}" >/dev/null 2>&1; done
|
|
kill -HUP "${RUNSVDIRPID:?}"; wait "${RUNSVDIRPID:?}"
|
|
}
|
|
trap stop EXIT TERM INT HUP
|
|
|
|
if [ "$#" -gt 0 ] || [ -t 0 ] || [ -t 1 ]; then
|
|
runsvdir -P "${SVDIR:?}" >/dev/null 2>&1 & RUNSVDIRPID=$!
|
|
"$@"
|
|
else
|
|
runsvdir -P "${SVDIR:?}" & RUNSVDIRPID=$!
|
|
wait "${RUNSVDIRPID:?}"
|
|
fi
|