Annotation of embedaddon/miniupnpd/minissdpd/minissdpd.init.d.script, revision 1.1.1.1
1.1 misho 1: #!/bin/sh
2: # $Id: minissdpd.init.d.script,v 1.2 2007/09/23 17:46:57 nanard Exp $
3: # MiniUPnP project
4: # author: Thomas Bernard
5: # website: http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
6:
7: MINISSDPD=/usr/sbin/minissdpd
8: PIDFILE=/var/run/minissdpd.pid
9: # get default interface
10: IF=`route | grep default |awk -- '{ print $8 }'`
11: ARGS="-i $IF"
12:
13: test -f $MINISSDPD || exit 0
14:
15: . /lib/lsb/init-functions
16:
17: case "$1" in
18: start) log_daemon_msg "Starting minissdpd" "minissdpd"
19: start-stop-daemon --start --quiet --pidfile $PIDFILE \
20: --exec $MINISSDPD -- $ARGS $LSBNAMES
21: log_end_msg $?
22: ;;
23: stop) log_daemon_msg "Stopping minissdpd" "minissdpd"
24: start-stop-daemon --stop --quiet --pidfile $PIDFILE
25: log_end_msg $?
26: ;;
27: restart|reload|force-reload)
28: log_daemon_msg "Restarting minissdpd" "minissdpd"
29: start-stop-daemon --stop --retry 5 --quiet --pidfile $PIDFILE
30: start-stop-daemon --start --quiet --pidfile $PIDFILE \
31: --exec $MINISSDPD -- $ARGS $LSBNAMES
32: log_end_msg $?
33: ;;
34: *) log_action_msg "Usage: /etc/init.d/minissdpd {start|stop|restart|reload|force-reload}"
35: exit 2
36: ;;
37: esac
38: exit 0
39:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>