noagendastream.sh: fix syntax error and player detection
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>
This commit is contained in:
+10
-6
@@ -1,10 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
STREAM="http://listen.noagendastream.com/noagenda"
|
||||
|
||||
if [ -f /usr/bin/mpv ];then
|
||||
mpv "http://listen.noagendastream.com/noagenda"
|
||||
elif [ -f "/usr/bin/vlc" ];then
|
||||
vlc "http://listen.noagendastream.com/noagenda"
|
||||
else [ -f "/usr/bin/xdg-open" ];then
|
||||
xdg-open "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
|
||||
|
||||
Reference in New Issue
Block a user