1
0

Added bash scripts that are used in Ezstream to fetch the next song, and for Icecast to handle conns/disconns.

This commit is contained in:
Alexander Andreev 2023-09-30 23:59:06 +04:00
parent 328dbc644e
commit 61e2f6d8fd
Signed by: Arav
GPG Key ID: D22A817D95815393
3 changed files with 34 additions and 0 deletions

14
tools/radiodj-fetch Normal file
View File

@ -0,0 +1,14 @@
#!/usr/bin/env sh
radiodj_socket=/var/run/dwelling-radio/djsock
radiodj_playlist_url=http:/playlist
CURL_FLAGS=--unix-socket $radiodj_socket $radiodj_playlist_url -o /dev/null -s -w "%{response_code}"
read -r song response <<< "$(curl -XGET $CURL_FLAGS)"
if [ "$response" -ne "200" ]; then
exit 1;
fi
echo $song

View File

@ -0,0 +1,10 @@
#!/usr/bin/env sh
radiodj_socket=/var/run/dwelling-radio/djsock
radiodj_listener_url=http:/listener
response=$(curl -XPOST --unix-socket $radiodj_socket $radiodj_listener_url -o /dev/null -s -w "%{response_code}")
if [ "$response" -ne "201" ]; then
exit 1;
fi

View File

@ -0,0 +1,10 @@
#!/usr/bin/env sh
radiodj_socket=/var/run/dwelling-radio/djsock
radiodj_listener_url=http:/listener
response=$(curl -XDELETE --unix-socket $radiodj_socket $radiodj_listener_url -o /dev/null -s -w "%{response_code}")
if [ "$response" -ne "204" ]; then
exit 1;
fi