Skip to content

Commit 3f67d38

Browse files
committed
work around broken jsonfilter (fixes #18)
1 parent f4517fe commit 3f67d38

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

root/usr/libexec/rpcd/luci.https-dns-proxy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ readonly providersJson="/usr/share/${packageName}/providers.json"
1818
. "${IPKG_INSTROOT}/usr/share/libubox/jshn.sh"
1919

2020
is_enabled() { "/etc/init.d/${1}" enabled; }
21-
is_running() { [ "$(ubus call service list "{\"name\":\"$1\"}" | jsonfilter -q -e "@['$1'].instances[*].running" | uniq)" = 'true' ]; }
21+
is_running() { local _json; _json="$(ubus call service list "{\"name\":\"$1\"}")"; [ "$(jsonfilter -q -s "$_json" -e "@[\"$1\"].instances.*.running" | uniq)" = 'true' ]; }
2222
get_version() { /usr/sbin/https-dns-proxy -V | head -1; }
2323
check_http2() { /usr/sbin/https-dns-proxy -V | grep -q 'nghttp2'; }
2424
check_http3() { /usr/sbin/https-dns-proxy -V | grep -q 'nghttp3'; }
25-
ubus_get_ports() { ubus call service list "{\"name\":\"$packageName\"}" | jsonfilter -e "@['${packageName}'].instances[*].data.firewall.*.dest_port"; }
25+
ubus_get_ports() { local _json; _json="$(ubus call service list "{\"name\":\"$packageName\"}")"; jsonfilter -s "$_json" -e "@[\"${packageName}\"].instances.*.data.firewall.*.dest_port"; }
2626
logger() { /usr/bin/logger -t "$packageName" "$@"; }
2727
print_json_bool() { json_init; json_add_boolean "$1" "$2"; json_dump; json_cleanup; }
2828

0 commit comments

Comments
 (0)