fix shitty bugs, fuck shell script they piss me off
This commit is contained in:
10
stop_all.sh
10
stop_all.sh
@@ -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."
|
||||
|
||||
Reference in New Issue
Block a user