xref: /OK3568_Linux_fs/buildroot/package/ssdp-responder/S50ssdpd (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1#!/bin/sh
2
3NAME=ssdpd
4PIDFILE=/var/run/$NAME.pid
5DAEMON=/usr/sbin/$NAME
6CFGFILE=/etc/default/$NAME
7
8DAEMON_ARGS=""
9
10# Read configuration variable file if it is present
11[ -f $CFGFILE ] && . $CFGFILE
12
13start() {
14	printf 'Starting %s: ' "$NAME"
15	start-stop-daemon -S -q -p $PIDFILE -x $DAEMON -- $DAEMON_ARGS
16	[ $? = 0 ] && echo "OK" || echo "FAIL"
17}
18
19stop() {
20	printf 'Stopping %s: ' "$NAME"
21	start-stop-daemon -K -q -p $PIDFILE -x $DAEMON
22	[ $? = 0 ] && echo "OK" || echo "FAIL"
23}
24
25restart() {
26	stop
27	start
28}
29
30case "$1" in
31    start|stop|restart)
32	"$1"
33	;;
34    reload)
35	restart
36	;;
37    *)
38	echo "Usage: $0 {start|stop|restart|reload}"
39	exit 1
40esac
41
42exit $?
43