aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2019-09-19 07:16:49 +0200
committerJo-Philipp Wich <jo@mein.io>2019-09-19 07:20:32 +0200
commitc933b6d22478c1113629ef549beea6337f978d62 (patch)
tree4e06f2e44ebbb5d395454ca55001f674ba570c1c
parent5ef9e4f107a94c502908403fdf56cf6bcdc08dd2 (diff)
downloadupstream-c933b6d22478c1113629ef549beea6337f978d62.tar.gz
upstream-c933b6d22478c1113629ef549beea6337f978d62.tar.bz2
upstream-c933b6d22478c1113629ef549beea6337f978d62.zip
procd: fix invalid JSON filter expression in procd_running()
Since service and instance names may contain characters which are not allowed in JSON path labels, such as dashes or spaces, change the filter expression to array square bracket notation to properly match these cases as well. Fixes: 2c3dd70741 ("procd: add procd_running() helper for checking running state") Signed-off-by: Jo-Philipp Wich <jo@mein.io>
-rw-r--r--package/system/procd/Makefile2
-rw-r--r--package/system/procd/files/procd.sh2
2 files changed, 2 insertions, 2 deletions
diff --git a/package/system/procd/Makefile b/package/system/procd/Makefile
index 07deda58e9..1018bc65e6 100644
--- a/package/system/procd/Makefile
+++ b/package/system/procd/Makefile
@@ -8,7 +8,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=procd
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=$(PROJECT_GIT)/project/procd.git
diff --git a/package/system/procd/files/procd.sh b/package/system/procd/files/procd.sh
index a9d2b341be..014b4499e1 100644
--- a/package/system/procd/files/procd.sh
+++ b/package/system/procd/files/procd.sh
@@ -412,7 +412,7 @@ procd_running() {
json_init
json_add_string name "$service"
- running=$(_procd_ubus_call list | jsonfilter -e "@.$service.instances.${instance}.running")
+ running=$(_procd_ubus_call list | jsonfilter -e "@['$service'].instances['$instance'].running")
[ "$running" = "true" ]
}