treewide: fix procd service inactive
authorTianling Shen <cnsztl@immortalwrt.org>
Mon, 17 Oct 2022 12:46:28 +0000 (20:46 +0800)
committerRosen Penev <rosenp@gmail.com>
Tue, 18 Oct 2022 14:22:43 +0000 (07:22 -0700)
Exit directly will result procd service inactive and uci
configuration changes are no longer monitored.

Reported-by: Lvc Revincx <revincx233@gmail.com>
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
net/cloudflared/files/cloudflared.init
net/dnsproxy/files/dnsproxy.init
net/v2ray-core/files/v2ray.init
net/v2raya/files/v2raya.init
net/xray-core/files/xray.init

index fdf028618353e9b25cfdc2c2983772372bb1ff5a..4fac31aac43131b3e9de07378a0bf68ff653e0d0 100755 (executable)
@@ -18,7 +18,7 @@ start_service() {
 
        local enabled
        config_get_bool enabled "config" "enabled"
-       [ "$enabled" -eq "1" ] || exit 1
+       [ "$enabled" -eq "1" ] || return 1
 
        procd_open_instance "$CONF"
        procd_set_param command "$PROG" "tunnel"
index 9ac2751b3e68b868d1de11f600453a97bc56bae4..1514ee152630b558ec470e66460597ebffda0da0 100644 (file)
@@ -88,7 +88,7 @@ load_config_param() {
 start_service() {
        config_load "$CONF"
 
-       is_enabled "global" "enabled" || exit 1
+       is_enabled "global" "enabled" || return 1
 
        procd_open_instance "$CONF"
        procd_set_param command "$PROG"
index e43f511835d35770f7f7ca8b552539adc07d8d40..c19bd9cab6531542e5630da6d143595198f79137 100755 (executable)
@@ -11,7 +11,7 @@ start_service() {
 
        local enabled
        config_get_bool enabled "enabled" "enabled" "0"
-       [ "$enabled" -eq "0" ] && exit 1
+       [ "$enabled" -eq "1" ] || return 1
 
        local confdir
        local conffiles
index a8295b6f45076e344ce2d037d2e85ed4e670a454..9c207f7d947a03686572fcef93968ada9d8f9cef 100755 (executable)
@@ -34,7 +34,7 @@ append_env_bool() {
 start_service() {
        config_load "$CONF"
 
-       is_enabled "config" "enabled" || exit 1
+       is_enabled "config" "enabled" || return 1
 
        procd_open_instance "$CONF"
        procd_set_param command "$PROG"
index a24255e9d56d1cad99e315cbcae852f9960805cd..7e4b8a7dbdb1e16bd8c758af5d51aa5c20d6b085 100755 (executable)
@@ -10,8 +10,8 @@ start_service() {
        config_load "$CONF"
 
        local enabled
-       config_get enabled "enabled" "enabled" "0"
-       [ "$enabled" -eq "0" ] && exit 1
+       config_get_bool enabled "enabled" "enabled" "0"
+       [ "$enabled" -eq "1" ] || return 1
 
        local confdir
        local conffiles