aboutsummaryrefslogtreecommitdiffstats
path: root/package/system/procd/files
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2016-07-29 14:19:17 +0200
committerFelix Fietkau <nbd@nbd.name>2016-07-29 16:41:09 +0200
commitf88e3a4c0abb60bb76a7678dd30dfdc8a808a2f1 (patch)
tree9e12dbbf0261f43a11ba142e16ee13fbdb722050 /package/system/procd/files
parentc02f41c1d2f2626de551da01c800938066e564c6 (diff)
downloadupstream-f88e3a4c0abb60bb76a7678dd30dfdc8a808a2f1.tar.gz
upstream-f88e3a4c0abb60bb76a7678dd30dfdc8a808a2f1.tar.bz2
upstream-f88e3a4c0abb60bb76a7678dd30dfdc8a808a2f1.zip
procd: add default timeout for reload trigger actions
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'package/system/procd/files')
-rw-r--r--package/system/procd/files/procd.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/package/system/procd/files/procd.sh b/package/system/procd/files/procd.sh
index 693a045be5..fa6f8a9792 100644
--- a/package/system/procd/files/procd.sh
+++ b/package/system/procd/files/procd.sh
@@ -32,6 +32,7 @@
. $IPKG_INSTROOT/usr/share/libubox/jshn.sh
+PROCD_RELOAD_DELAY=1000
_PROCD_SERVICE=
_procd_call() {
@@ -221,6 +222,11 @@ _procd_set_param() {
esac
}
+_procd_add_timeout() {
+ [ "$PROCD_RELOAD_DELAY" -gt 0 ] && json_add_int "" "$PROCD_RELOAD_DELAY"
+ return 0
+}
+
_procd_add_interface_trigger() {
json_add_array
_procd_add_array_data "$1"
@@ -240,6 +246,8 @@ _procd_add_interface_trigger() {
json_close_array
json_close_array
+
+ _procd_add_timeout
}
_procd_add_reload_interface_trigger() {
@@ -271,6 +279,8 @@ _procd_add_config_trigger() {
json_close_array
json_close_array
+
+ _procd_add_timeout
}
_procd_add_raw_trigger() {