Skip to content

Instantly share code, notes, and snippets.

@kvaps
Created December 17, 2015 14:33
Show Gist options
  • Save kvaps/45675d0d608815ba5619 to your computer and use it in GitHub Desktop.
Save kvaps/45675d0d608815ba5619 to your computer and use it in GitHub Desktop.
icecast=play.artradio.su:8000 #радио-сервер IceCast
mountpoint="/mp3_192" #имя точки монтирования
#получаем статистику с сервера
req=$(curl http://$icecast/status2.xsl -s)
#ищем точку монтирования в статистике
if [[ "$req" != *"$mountpoint"* ]];
then
echo $(date +"%y-%m-%d %T") "Watchdog: Stream not fond. Rebooting server..."
#перезапускаем вещалку
systemctl restart liquidsoap
else
echo $(date +"%y-%m-%d %T") "Watchdog: All is OK"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment