Files
pulse-soundboard/stop_all.sh
2026-01-06 02:00:10 +00:00

16 lines
423 B
Bash
Executable File

#!/usr/bin/env bash
STATE="$HOME/.soundboard"
if [[ -f "$STATE/playing.pids" ]]; then
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"
fi