• Skip to sidebar navigation
  • Skip to content

Bitbucket

  • More
    ProjectsRepositories
  • Help
    • Online help
    • Learn Git
    • Welcome to Bitbucket
    • Keyboard shortcuts
  • Log In
Alexander Dahl
  1. Alexander Dahl

buildroot

Public
Actions
  • Clone
  • Compare

Learn more about cloning repositories

You have read-only access

Navigation
  • Source
  • Commits
  • Branches
  • All Branches Graph
  • Forks
  1. Alexander Dahl
  2. buildroot

Source

buildroot/package/igd2-for-linux/S99upnpd
Fabrice FontaineFabrice Fontaine committed 5823088298221 Jul 2016
Raw file
Source viewDiff to previous
xxxxxxxxxx
 
1
#!/bin/sh
2
​
3
NAME=upnpd
4
PIDFILE=/var/run/$NAME.pid
5
DAEMON=/usr/sbin/$NAME
6
CFGFILE=/etc/default/$NAME
7
​
8
LAN=eth0
9
WAN=eth0
10
​
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
15
# not function.
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
19
​
20
# Read configuration variable file if it is present
21
if [ -f $CFGFILE ]; then
22
    . $CFGFILE
23
fi
24
​
25
DAEMON_ARGS="-f $WAN $LAN"
26
​
27
start() {
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
31
    fi
32
    printf "Starting $NAME: "
33
    start-stop-daemon -S -q -m -b -p $PIDFILE --exec $DAEMON -- $DAEMON_ARGS
34
    [ $? = 0 ] && echo "OK" || echo "FAIL"
35
}
36
​
37
stop() {
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
44
    fi
45
}
46
​
47
restart() {
48
    stop
49
    start
50
}
51
​
52
case "$1" in
53
  start)
54
    start
55
    ;;
56
  stop)
57
    stop
58
    ;;
59
  restart|reload)
60
    restart
61
    ;;
62
  *)
63
    echo "Usage: $0 {start|stop|restart|reload}"
  • Git repository management for enterprise teams powered by Atlassian Bitbucket
  • Atlassian Bitbucket v6.7.2
  • Documentation
  • Request a feature
  • About
  • Contact Atlassian
Atlassian

Everything looks good. We'll let you know here if there's anything you should know about.