| 1 |
#!/bin/sh |
| 2 |
|
| 3 |
server=localhost |
| 4 |
|
| 5 |
set -e |
| 6 |
|
| 7 |
PATH=/usr/sbin:$PATH |
| 8 |
export PATH |
| 9 |
|
| 10 |
at_exit() { |
| 11 |
echo "Info: Test exiting" |
| 12 |
} |
| 13 |
|
| 14 |
trap at_exit INT TERM EXIT |
| 15 |
|
| 16 |
systemctl enable --now icecast2 2>/dev/null || \ |
| 17 |
update-rc.d icecast2 enable && invoke-rc.d icecast2 start |
| 18 |
|
| 19 |
echo "Info: Reporting daemon status" |
| 20 |
if service icecast2 status ; then |
| 21 |
echo "Success: service reported success" |
| 22 |
fi |
| 23 |
|
| 24 |
if curl -s http://$server:8000/ | grep -q icecast.org ; then |
| 25 |
echo "Success: HTTP request to Icecast server worked." |
| 26 |
else |
| 27 |
echo "Failure: HTTP request to Icecast server did not contain the words icecast.org." |
| 28 |
exit 1 |
| 29 |
fi |