luci-app-statistics: convert init script to procd
authorJo-Philipp Wich <jo@mein.io>
Wed, 2 May 2018 05:13:34 +0000 (07:13 +0200)
committerJo-Philipp Wich <jo@mein.io>
Wed, 2 May 2018 05:15:58 +0000 (07:15 +0200)
Convert init script to procd format in order to register reload triggers
on /etc/config/luci_statistics.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
applications/luci-app-statistics/root/etc/init.d/luci_statistics

index ab75b69df0c33d2c9de9e506b5091da0357068f0..2dc176c83c8609d1c2959855ca6c1546088dcb23 100755 (executable)
@@ -1,7 +1,14 @@
 #!/bin/sh /etc/rc.common
+
 START=79
+USE_PROCD=1
+
+service_triggers()
+{
+       procd_add_reload_trigger "luci_statistics"
+}
 
-start() {
+start_service() {
        ### replace shipped config with symlink
        mkdir -p /var/etc
        if [ ! -L /etc/collectd.conf ]; then
@@ -16,6 +23,10 @@ start() {
        chmod 1777 /tmp
 }
 
+reload_service() {
+       restart "$@"
+}
+
 restart() {
        ### regenerate config / prepare environment
        start