#!/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."