projects
/
openwrt
/
.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
procd: allow usage of * as procd_running() instance parameter
[openwrt/.git]
/
package
/
system
/
procd
/
files
/
procd.sh
diff --git
a/package/system/procd/files/procd.sh
b/package/system/procd/files/procd.sh
index 014b4499e15e57ead2aa709323bc917eedb74e58..b8f9a210f69785b3ad039d918de6a15104fe2db6 100644
(file)
--- 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"
procd_running() {
local service="$1"
- local instance="${2:-
instance1
}"
- local running
+ local instance="${2:-
*
}"
+ [ "$instance" = "*" ] || instance="'$instance'"
json_init
json_add_string name "$service"
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" ]
}
[ "$running" = "true" ]
}