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