Replace the invalid 'else [ ... ];then' with elif, detect players with command -v, and print an error when no player is installed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
15 lines
309 B
Bash
Executable File
15 lines
309 B
Bash
Executable File
#!/bin/bash
|
|
|
|
STREAM="http://listen.noagendastream.com/noagenda"
|
|
|
|
if command -v mpv >/dev/null 2>&1; then
|
|
mpv "$STREAM"
|
|
elif command -v vlc >/dev/null 2>&1; then
|
|
vlc "$STREAM"
|
|
elif command -v xdg-open >/dev/null 2>&1; then
|
|
xdg-open "$STREAM"
|
|
else
|
|
echo "No player found. Install mpv or vlc." >&2
|
|
exit 1
|
|
fi
|