miniupnpd: implement an 'enabled' flag

Add a 'master' miniupnpd service enable flag rather than just relying on
rcS.d script existence.  This allows the service to be disabled across
sysupgrade, similar to minidlna.

The service assumes enabled if no 'enabled' config flag is configured
for backwards compatibility.

Signed-off-by: Kevin Darbyshire-Bryant <kevin@darbyshire-bryant.me.uk>
(cherry picked from commit 33dc373da9)
This commit is contained in:
Kevin Darbyshire-Bryant 2017-02-11 19:13:29 +00:00 committed by Hannu Nyman
parent b4c1d4c02b
commit 471d3660b4
2 changed files with 6 additions and 1 deletions

View File

@ -68,7 +68,11 @@ start() {
local extip port usesysuptime conffile serial_number model_number
local uuid notify_interval presentation_url enable_upnp
local upnp_lease_file clean_ruleset_threshold clean_ruleset_interval
local ipv6_listening_ip
local ipv6_listening_ip enabled
config_get_bool enabled config enabled 1
[ "$enabled" -gt 0 ] || return 1
config_get extiface config external_iface
config_get extzone config external_zone

View File

@ -1,4 +1,5 @@
config upnpd config
option enabled 0
option enable_natpmp 1
option enable_upnp 1
option secure_mode 1