minidlna: restore service triggers 12572/head
authorJo-Philipp Wich <jo@mein.io>
Mon, 22 Jun 2020 08:11:23 +0000 (10:11 +0200)
committerJo-Philipp Wich <jo@mein.io>
Mon, 22 Jun 2020 08:16:06 +0000 (10:16 +0200)
Restore service triggers which got wrongly removed in commit
733aae9584ef92c327b9008142602a7e69cfec3b ("fix issues").

Without triggers, changing settings from LuCI or calling reload_config
from the cli won't have any effect.

Also adjust the uci commit call to only commit the minidlna configuration
when setting a UUID, to avoid committing unrelated user changes in other
config files.

Ref: https://github.com/openwrt/luci/issues/4194
Fixes: 733aae958 ("minidlna: fix issues")
Fixes: 37367bdc8 ("minidlna: create UUID in config if it is empty")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
multimedia/minidlna/Makefile
multimedia/minidlna/files/minidlna.init

index fb69aa4f9ff99a59bc79beaab9b3471b032b045a..b701fcaaf91358bf2e8c99083b47a1e96590c3a5 100644 (file)
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=minidlna
-PKG_RELEASE:=6
+PKG_RELEASE:=7
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://git.code.sf.net/p/minidlna/git
index 27baa47ff216b2faf578d319b7b4890a9c2e7711..326dc2a0e7ee133f8432a9a4629acaffc22c7c7d 100644 (file)
@@ -83,7 +83,7 @@ start_service() {
        [ "$enabled" -gt 0 ] || return 1
 
        config_get val "config" uuid
-       [ "$val" = '' ] && uci set minidlna.config.uuid="$(cat /proc/sys/kernel/random/uuid)" && uci commit
+       [ "$val" = '' ] && uci set minidlna.config.uuid="$(cat /proc/sys/kernel/random/uuid)" && uci commit minidlna
 
        minidlna_create_config config || return 1
 
@@ -103,3 +103,7 @@ start_service() {
        procd_set_param respawn
        procd_close_instance
 }
+
+service_triggers() {
+       procd_add_reload_trigger "minidlna"
+}