File: test-daemon

package info (click to toggle)
icecast2 2.5.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,560 kB
  • sloc: ansic: 34,522; sh: 5,187; makefile: 376; xml: 106; javascript: 88
file content (29 lines) | stat: -rwxr-xr-x 605 bytes parent folder | download | duplicates (2)
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