From a6dc75428c1e3a47700b5c164a16385b5c640b48 Mon Sep 17 00:00:00 2001 From: Florian Eckert Date: Fri, 6 Dec 2019 15:28:36 +0100 Subject: [PATCH] mwan3: switch to procd init script This enables the procd handling for mwan3 on config change. Signed-off-by: Florian Eckert --- net/mwan3/files/etc/init.d/mwan3 | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/net/mwan3/files/etc/init.d/mwan3 b/net/mwan3/files/etc/init.d/mwan3 index 2dccef363..af750e55e 100755 --- a/net/mwan3/files/etc/init.d/mwan3 +++ b/net/mwan3/files/etc/init.d/mwan3 @@ -1,20 +1,28 @@ #!/bin/sh /etc/rc.common START=19 - -reload() { - /usr/sbin/mwan3 restart -} +USE_PROCD=1 boot() { . /lib/config/uci.sh uci_toggle_state mwan3 globals enabled "1" + mwan3_boot=1 + rc_procd start_service +} + +reload_service() { + /usr/sbin/mwan3 restart } -start() { +start_service() { + [ -n "${mwan3_boot}" ] && return 0 /usr/sbin/mwan3 start } -stop() { +stop_service() { /usr/sbin/mwan3 stop } + +service_triggers() { + procd_add_reload_trigger 'mwan3' +}