From: cshore Date: Sun, 6 Mar 2011 18:57:14 +0000 (+0000) Subject: [net] miniupnpd: Added uci configuration option to set uuid. A uuid is automatically... X-Git-Url: http://207.154.207.93/?a=commitdiff_plain;h=5022084a20ae2eca045f23fe252dd83a28a1e6ac;p=packages.git [net] miniupnpd: Added uci configuration option to set uuid. A uuid is automatically generated and added to the configuration file on the first boot of miniupnpd with no uuid. This closes: #6634. Current behaviour (non-unique UUID by way of no UUID being configured) can be obtained by using a uuid of 'nocli' (for no command line [uuid]) git-svn-id: svn://svn.openwrt.org/openwrt/packages@25901 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- diff --git a/net/miniupnpd/files/miniupnpd.init b/net/miniupnpd/files/miniupnpd.init index ff578fe83..a53fa2d37 100644 --- a/net/miniupnpd/files/miniupnpd.init +++ b/net/miniupnpd/files/miniupnpd.init @@ -8,6 +8,7 @@ start() { config_load "upnpd" local extiface intiface upload download logging secure enabled natpmp local extip port usesysuptime conffile serial_number model_number + local uuid config_get extiface config external_iface config_get intiface config internal_iface @@ -23,6 +24,7 @@ start() { config_get conffile config config_file config_get serial_number config serial_number config_get model_number config model_number + config_get uuid config uuid include /lib/network scan_interfaces @@ -67,6 +69,15 @@ start() { [ -n "${model_number}" ] && \ append args "-m ${model_number}" + [ -z "$uuid" ] && { + uuid="$(cat /proc/sys/kernel/random/uuid)" + uci set upnpd.config.uuid=$uuid + uci commit upnpd + } + + [ "$uuid" = "nocli" ] || \ + append args "-u $uuid" + # start firewall local zone config_load firewall