summaryrefslogtreecommitdiff
blob: 8fb613d1138aebafdd197ba1f05110a339dd94c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/sbin/runscript

MINISSDPD="/usr/sbin/minissdpd"
PIDFILE="/var/run/minissdpd.pid"

depend() {
	need net
	before miniupnpd
}

start() {
	ebegin "Starting minissdpd"
	IF=$(/sbin/route | grep default | awk -- '{ print $8 }')
	ARGS="-i $(/sbin/ifconfig $IF | grep 'inet addr' | sed 's/.\+inet addr:\([0-9.]\+\).\+/\1/')"
	start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $MINISSDPD -- $ARGS
	eend $?
}

stop() {
	ebegin "Stopping minissdpd"
	start-stop-daemon --stop --pidfile "${PIDFILE}"
	eend $?
}