summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathias Kresin <dev@kresin.me>2017-10-15 10:33:29 +0200
committerMathias Kresin <dev@kresin.me>2017-10-25 08:45:05 +0200
commitd456a888d07e97491ad2d57f470801bbbc4c06a6 (patch)
tree0c304b8a9d38cd19232b34d88b0b00395d9fc90d
parent664369f6b281b961718b247e3b6b2d55fc6a5f7a (diff)
downloadmtk-20170518-d456a888d07e97491ad2d57f470801bbbc4c06a6.zip
mtk-20170518-d456a888d07e97491ad2d57f470801bbbc4c06a6.tar.gz
mtk-20170518-d456a888d07e97491ad2d57f470801bbbc4c06a6.tar.bz2
ltq-adsl-app: convert init script to procd
Use the procd features for the init script. Signed-off-by: Mathias Kresin <dev@kresin.me>
-rw-r--r--package/network/config/ltq-adsl-app/files/dsl_control17
1 files changed, 11 insertions, 6 deletions
diff --git a/package/network/config/ltq-adsl-app/files/dsl_control b/package/network/config/ltq-adsl-app/files/dsl_control
index 8218186..d93d478 100644
--- a/package/network/config/ltq-adsl-app/files/dsl_control
+++ b/package/network/config/ltq-adsl-app/files/dsl_control
@@ -2,14 +2,12 @@
# Copyright (C) 2012 OpenWrt.org
START=49
+USE_PROCD=1
EXTRA_COMMANDS="status lucistat"
EXTRA_HELP=" status Get DSL status information
lucistat Get status information if lua friendly format"
-SERVICE_DAEMONIZE=1
-SERVICE_WRITE_PID=1
-
[ -f /lib/functions/lantiq_dsl.sh ] && . /lib/functions/lantiq_dsl.sh
annex_b=10_00_10_00_00_04_00_00
@@ -28,7 +26,11 @@ annex_m2=00_00_00_00_40_00_00_00
annex_m2p=00_00_00_00_00_00_04_00
annex_j=10_00_10_40_00_04_01_00
-start() {
+service_triggers() {
+ procd_add_reload_trigger network
+}
+
+start_service() {
local annex
local firmware
local xtu
@@ -45,12 +47,15 @@ start() {
return 1
}
- service_start /sbin/dsl_cpe_control -i${xtu} \
+ procd_open_instance
+ procd_set_param command /sbin/dsl_cpe_control \
+ -i${xtu} \
-n /sbin/dsl_notify.sh \
-f ${firmware}
+ procd_close_instance
}
-stop() {
+stop_service() {
DSL_NOTIFICATION_TYPE="DSL_INTERFACE_STATUS" \
DSL_INTERFACE_STATUS="DOWN" \
/sbin/dsl_notify.sh