[packages] miniupnpd: Added uci option use_system_uptime which defaults to true to...
[openwrt/svn-archive/archive.git] / net / miniupnpd / files / miniupnpd.init
index 12404bd48f5e695f857291e7f7338a0922d8b2a3..3576af0285fb2f45d9979090b74098d7d7456abb 100644 (file)
@@ -7,17 +7,19 @@ start() {
 
        config_load "upnpd"
        local extiface intiface upload download logging secure enabled natpmp
-       local extip
+       local extip port usesystuptime
 
        config_get extiface config external_iface
        config_get intiface config internal_iface
        config_get extip config external_ip
+       config_get port config port 5000
        config_get upload   config upload
        config_get download config download
        config_get_bool logging config log_output 0
        config_get_bool secure config secure_mode 0
        config_get_bool natpmp config enable_natpmp 0
        config_get_bool enabled config enabled 0 
+       config_get_bool usesysuptime config use_system_uptime 1
 
        include /lib/network
        scan_interfaces
@@ -38,7 +40,11 @@ start() {
                        [ -n "$ipaddr" ] && append args "-a $ipaddr"
                done
 
-               append args "-p 5000 -U"
+               [ "$port" != "auto" ] && \
+                       append args "-p $port"
+               
+               [ "$usesysuptime" -eq 1 ] && \
+                       append args "-U"
 
                [ -n "$upload" -a -n "$download" ] && \
                        append args "-B $(($download * 1024 * 8)) $(($upload * 1024 * 8))"