aboutsummaryrefslogtreecommitdiffstats
path: root/package/system/procd/files/procd.sh
diff options
context:
space:
mode:
Diffstat (limited to 'package/system/procd/files/procd.sh')
-rw-r--r--package/system/procd/files/procd.sh6
1 files changed, 3 insertions, 3 deletions
diff --git a/package/system/procd/files/procd.sh b/package/system/procd/files/procd.sh
index 014b4499e1..b8f9a210f6 100644
--- a/package/system/procd/files/procd.sh
+++ b/package/system/procd/files/procd.sh
@@ -407,12 +407,12 @@ _procd_add_instance() {
procd_running() {
local service="$1"
- local instance="${2:-instance1}"
- local running
+ local instance="${2:-*}"
+ [ "$instance" = "*" ] || instance="'$instance'"
json_init
json_add_string name "$service"
- running=$(_procd_ubus_call list | jsonfilter -e "@['$service'].instances['$instance'].running")
+ local running=$(_procd_ubus_call list | jsonfilter -l 1 -e "@['$service'].instances[$instance].running")
[ "$running" = "true" ]
}