summaryrefslogtreecommitdiff
blob: 108d49c54d6d506bc0b34a2083b681fd486c7ddb (plain)
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
#!/sbin/runscript

depend() {
	need net
}

checkconfig() {
	source /etc/linuxigd/upnpd.conf
	if [ "$INTERFACE" = "" -o "$OUTERFACE" = "" ] ; then
		ewarn "You need to configure upnpd in /etc/linuxigd/upnpd.conf"
		return 1
	fi
	return 0
}

start() {
	checkconfig || return 1
	ebegin "Starting upnpd"
	/sbin/route add -net 239.0.0.0 netmask 255.0.0.0 $INTERFACE
	start-stop-daemon --start \
		--exec /usr/bin/upnpd -- $OUTERFACE $INTERFACE
	eend $?
}

stop() {
	ebegin "Stopping upnpd"
	/sbin/route del -net 239.0.0.0 netmask 255.0.0.0 $INTERFACE
	start-stop-daemon --stop --exec /usr/bin/upnpd
	eend $?
}