Skip to content

Commit

Permalink
Autostart and restart some number of radio streams (test mode, may be…
Browse files Browse the repository at this point in the history
… unstable).
  • Loading branch information
hirve committed Nov 10, 2023
1 parent ab1dccc commit 477cb90
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions generate-am-radio/start-some-streams
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash

DIR=`cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd`

streams='stream-template-1206am one-more-script-name'

while true
do
for stream in $streams
do
name=`echo $stream | grep -Po '[1-9]\d+am'`
freq=`echo $name | grep -Po '\d+'`

echo Checking "http://127.0.0.1:8092/$name".ogg

if ffprobe -v quiet "http://127.0.0.1:8092/$name".ogg
then
echo $name is OK
else
echo $name is FAIL, trying to restart...
$DIR/$stream &
fi
sleep 1
done
echo
sleep 10
done

0 comments on commit 477cb90

Please sign in to comment.