forked from miniupnp/miniupnp
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathminissdpd.init.d.script
39 lines (34 loc) · 1.17 KB
/
minissdpd.init.d.script
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
30
31
32
33
34
35
36
37
38
#!/bin/sh
# $Id: minissdpd.init.d.script,v 1.2 2007/09/23 17:46:57 nanard Exp $
# MiniUPnP project
# author: Thomas Bernard
# website: http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
MINISSDPD=/usr/sbin/minissdpd
PIDFILE=/var/run/minissdpd.pid
# get default interface
IF=`route | grep default |awk -- '{ print $8 }'`
ARGS="-i $IF"
test -f $MINISSDPD || exit 0
. /lib/lsb/init-functions
case "$1" in
start) log_daemon_msg "Starting minissdpd" "minissdpd"
start-stop-daemon --start --quiet --pidfile $PIDFILE \
--exec $MINISSDPD -- $ARGS $LSBNAMES
log_end_msg $?
;;
stop) log_daemon_msg "Stopping minissdpd" "minissdpd"
start-stop-daemon --stop --quiet --pidfile $PIDFILE
log_end_msg $?
;;
restart|reload|force-reload)
log_daemon_msg "Restarting minissdpd" "minissdpd"
start-stop-daemon --stop --retry 5 --quiet --pidfile $PIDFILE
start-stop-daemon --start --quiet --pidfile $PIDFILE \
--exec $MINISSDPD -- $ARGS $LSBNAMES
log_end_msg $?
;;
*) log_action_msg "Usage: /etc/init.d/minissdpd {start|stop|restart|reload|force-reload}"
exit 2
;;
esac
exit 0