-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Autostart and restart some number of radio streams (test mode, may be…
… unstable).
- Loading branch information
hirve
committed
Nov 10, 2023
1 parent
ab1dccc
commit 477cb90
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |