From 7aa71cb89137f246dc906095dbd42db374953601 Mon Sep 17 00:00:00 2001 From: Mollusk Date: Thu, 29 Oct 2026 14:19:19 -0400 Subject: [PATCH] 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 --- noagendastream.sh | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/noagendastream.sh b/noagendastream.sh index 11a198a..ae45ba5 100755 --- a/noagendastream.sh +++ b/noagendastream.sh @@ -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