Files
pulse-soundboard/stop_all.sh
2026-01-02 16:44:27 +00:00

18 lines
431 B
Bash
Executable File

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