X-Git-Url: http://git.ozo.com/?a=blobdiff_plain;ds=sidebyside;f=package%2Fsystem%2Fprocd%2Ffiles%2Fprocd.sh;h=b8f9a210f69785b3ad039d918de6a15104fe2db6;hb=ddf6ec29b477f0cf7ce7839c8c9710fb4b969621;hp=014b4499e15e57ead2aa709323bc917eedb74e58;hpb=91aabae8958d586a01eca6d47af579194f7c2116;p=openwrt%2F.git 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" ] }