arri
Registered
i'm trying to make a script that starts mpg123 with my favorite radiostation, and displays info about the currently playing track.
i succeeded so far, except for one problem;
i don't manage to make to script silent, and only output the track-info.
instead, on each loop, it outputs something that looks like the output of curl.
on closer inspection, the terminals' titlebar actually very briefly shows the name 'curl' when it outputs, and 'sleep' for the rest of the time..
so appearantly mpg123 (or at least version 0.59r) uses curl, but how can i make that the output of curl doesn't show?
here's the script:
i succeeded so far, except for one problem;
i don't manage to make to script silent, and only output the track-info.
instead, on each loop, it outputs something that looks like the output of curl.
on closer inspection, the terminals' titlebar actually very briefly shows the name 'curl' when it outputs, and 'sleep' for the rest of the time..
so appearantly mpg123 (or at least version 0.59r) uses curl, but how can i make that the output of curl doesn't show?
here's the script:
Code:
#!/bin/sh
mpg123 -qr 44100 http://000.000.000.000:8014/ & > /dev/null 2>&1
oldrespons="ouwe zooi"
while [ 1 ]
do
respons=$(curl http://this.url-contains.info/logs/radio-playing.txt)
if [ "$oldrespons" != "$respons" ]
then
clear
echo "cliqhop: $respons"
oldrespons="$respons"
fi
sleep 2
done