Skip to content

Commit f4517fe

Browse files
committed
double-quote ubus calls (fixes #18)
1 parent 7f4da27 commit f4517fe

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ PKG_NAME:=luci-app-https-dns-proxy
77
PKG_LICENSE:=AGPL-3.0-or-later
88
PKG_MAINTAINER:=Stan Grishin <stangri@melmac.ca>
99
PKG_VERSION:=2025.12.29
10-
PKG_RELEASE:=4
10+
PKG_RELEASE:=5
1111

1212
LUCI_TITLE:=DNS Over HTTPS Proxy Web UI
1313
LUCI_URL:=https://github.com/mossdef-org/luci-app-https-dns-proxy/

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,18 @@ 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() { [ "$(ubus call service list "{\"name\":\"$1\"}" | jsonfilter -q -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() { ubus call service list "{\"name\":\"$packageName\"}" | jsonfilter -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

2929
get_init_list() {
30-
local name="$1"
30+
local name
31+
name="$(basename "$1")"
32+
name="${name:-${packageName}}"
3133
json_init
3234
json_add_object "$name"
3335
if is_enabled "$name"; then
@@ -74,7 +76,6 @@ get_init_status() {
7476
json_add_boolean 'force_dns_active' '0'
7577
fi
7678
json_add_string 'version' "$version"
77-
json_close_array
7879
json_close_object
7980
json_dump
8081
json_cleanup

0 commit comments

Comments
 (0)