[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
This commit is contained in:
parent
5823187e08
commit
5022084a20
@ -8,6 +8,7 @@ start() {
|
|||||||
config_load "upnpd"
|
config_load "upnpd"
|
||||||
local extiface intiface upload download logging secure enabled natpmp
|
local extiface intiface upload download logging secure enabled natpmp
|
||||||
local extip port usesysuptime conffile serial_number model_number
|
local extip port usesysuptime conffile serial_number model_number
|
||||||
|
local uuid
|
||||||
|
|
||||||
config_get extiface config external_iface
|
config_get extiface config external_iface
|
||||||
config_get intiface config internal_iface
|
config_get intiface config internal_iface
|
||||||
@ -23,6 +24,7 @@ start() {
|
|||||||
config_get conffile config config_file
|
config_get conffile config config_file
|
||||||
config_get serial_number config serial_number
|
config_get serial_number config serial_number
|
||||||
config_get model_number config model_number
|
config_get model_number config model_number
|
||||||
|
config_get uuid config uuid
|
||||||
|
|
||||||
include /lib/network
|
include /lib/network
|
||||||
scan_interfaces
|
scan_interfaces
|
||||||
@ -67,6 +69,15 @@ start() {
|
|||||||
[ -n "${model_number}" ] && \
|
[ -n "${model_number}" ] && \
|
||||||
append args "-m ${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
|
# start firewall
|
||||||
local zone
|
local zone
|
||||||
config_load firewall
|
config_load firewall
|
||||||
|
Loading…
x
Reference in New Issue
Block a user