File: test-daemon

package info (click to toggle)
icecast2 2.4.4-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, trixie
  • size: 5,732 kB
  • sloc: ansic: 18,826; sh: 4,369; makefile: 200
file content (25 lines) | stat: -rwxr-xr-x 482 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
#!/bin/sh

server=localhost

set -e

PATH=/usr/sbin:$PATH
export PATH

at_exit() {
    echo "info: test exiting"
}

trap at_exit INT TERM EXIT

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."
fi