4 PIDFILE
=/var
/run
/$NAME.pid
6 CFGFILE
=/etc
/default
/$NAME
11 # For the UPnP library to function correctly, networking must be configured
12 # properly for multicasting as described in
13 # https://sourceforge.net/p/pupnp/code/ci/master/tree/README.
14 # Without this addition, device advertisements and control point searches will
16 # However, the route has to be configured once for all UPnP applications
17 # (igd2-for-linux, ushare, ...) so do not manage UPnP route by default
18 MANAGE_UPNP_MULTICAST_ROUTE_ON_LAN
=0
20 # Read configuration variable file if it is present
21 if [ -f $CFGFILE ]; then
25 DAEMON_ARGS
="-f $WAN $LAN"
28 if [ $MANAGE_UPNP_MULTICAST_ROUTE_ON_LAN != 0 ]; then
29 printf "Add UPnP multicast route on $LAN\n"
30 route add
-net 239.0.0.0 netmask
255.0.0.0 $LAN
32 printf "Starting $NAME: "
33 start-stop-daemon
-S -q -m -b -p $PIDFILE --exec $DAEMON -- $DAEMON_ARGS
34 [ $?
= 0 ] && echo "OK" ||
echo "FAIL"
38 printf "Stopping $NAME: "
39 start-stop-daemon
-K -q -p $PIDFILE
40 [ $?
= 0 ] && echo "OK" ||
echo "FAIL"
41 if [ $MANAGE_UPNP_MULTICAST_ROUTE_ON_LAN != 0 ]; then
42 printf "Remove UPnP multicast route on $LAN\n"
43 route del
-net 239.0.0.0 netmask
255.0.0.0 $LAN
63 echo "Usage: $0 {start|stop|restart|reload}"