Gracefully kill caddy to avoid singal killing beets

This commit is contained in:
IamTheFij 2020-11-18 16:42:11 -08:00
parent 50897ae465
commit 091389c47d

View File

@ -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"/*