Gracefully kill caddy to avoid singal killing beets
This commit is contained in:
parent
50897ae465
commit
091389c47d
8
play.sh
8
play.sh
@ -6,6 +6,10 @@ cp "$1" "$PLAYDIR/play"
|
|||||||
for f in "$@"; do
|
for f in "$@"; do
|
||||||
cp "$f" "$PLAYDIR/$(basename "$f")"
|
cp "$f" "$PLAYDIR/$(basename "$f")"
|
||||||
done
|
done
|
||||||
caddy file-server --listen :9999 --browse --root "$PLAYDIR"
|
caddy file-server --listen :9999 --browse --root "$PLAYDIR" &
|
||||||
|
caddy_pid=$!
|
||||||
|
sleep 2
|
||||||
|
read -sr -n 1 -p "Press any key to stop server"
|
||||||
|
echo
|
||||||
|
kill -9 $caddy_pid
|
||||||
rm "$PLAYDIR"/*
|
rm "$PLAYDIR"/*
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user