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:
parent
328dbc644e
commit
61e2f6d8fd
14
tools/radiodj-fetch
Normal file
14
tools/radiodj-fetch
Normal 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
|
10
tools/radiodj-listener-connect
Normal file
10
tools/radiodj-listener-connect
Normal 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
|
10
tools/radiodj-listener-disconnect
Normal file
10
tools/radiodj-listener-disconnect
Normal 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
|
Loading…
Reference in New Issue
Block a user