fix shitty bugs, fuck shell script they piss me off

This commit is contained in:
William Bell
2026-01-02 16:44:27 +00:00
parent eb2e6ee917
commit 5f4727aae3
4 changed files with 48 additions and 12 deletions

View File

@@ -4,10 +4,14 @@ STATE="$HOME/.soundboard"
[[ -f "$STATE/playing.pids" ]] || exit 0
while read -r PGID; do
kill -TERM -- "-$PGID" 2>/dev/null || true
while read -r PID; do
# Check if process exists before sending SIGINT
if [[ -n "$PID" ]] && kill -0 "$PID" 2>/dev/null; then
kill -INT "$PID" 2>/dev/null || true
fi
done < "$STATE/playing.pids"
# Clear the PID file after attempting to stop everything
rm -f "$STATE/playing.pids"
echo "All soundboard playback stopped."
echo "All soundboard playback stopped."