summaryrefslogtreecommitdiff
path: root/net/https-dns-proxy/files/https-dns-proxy.init
diff options
context:
space:
mode:
authorStan Grishin <stangri@melmac.net>2020-03-13 02:36:58 +0000
committerGerard Ryan <G.M0N3Y.2503@gmail.com>2020-03-13 21:31:02 +1000
commit5b03da037ab0c4e4bdc4ac4ee19415c2c951791c (patch)
tree398fdde2c83e41b57dea283a72f76246172a53dd /net/https-dns-proxy/files/https-dns-proxy.init
parent3d9b512685068514c3cd09346acbfd7d8c4f3ac1 (diff)
https-dns-proxy: shellcheck & beautify
Signed-off-by: Stan Grishin <stangri@melmac.net>
Diffstat (limited to 'net/https-dns-proxy/files/https-dns-proxy.init')
-rwxr-xr-xnet/https-dns-proxy/files/https-dns-proxy.init14
1 files changed, 8 insertions, 6 deletions
diff --git a/net/https-dns-proxy/files/https-dns-proxy.init b/net/https-dns-proxy/files/https-dns-proxy.init
index 8dd509edb..0267235d4 100755
--- a/net/https-dns-proxy/files/https-dns-proxy.init
+++ b/net/https-dns-proxy/files/https-dns-proxy.init
@@ -48,12 +48,14 @@ start_instance() {
append_bool "$cfg" 'use_http1' '-x'
config_get verbosity "$cfg" 'verbosity' "0"
+# shellcheck disable=SC2086,SC2154
for i in $(seq 1 $verbosity); do
xappend "-v"
done
- config_get_bool ipv6_resolvers_only "$cfg" 'ipv6_resolvers_only' '0'
- if [ "$ipv6_resolvers_only" == 0 ]; then
+ config_get_bool ipv6_resolvers_only "$cfg" 'use_ipv6_resolvers_only' '0'
+# shellcheck disable=SC2154
+ if [ "$ipv6_resolvers_only" = 0 ]; then
xappend "-4"
fi
@@ -123,8 +125,8 @@ dnsmasq_add_doh_server() {
;;
esac
- uci -q del_list dhcp."$cfg".server="$address#$port"
- uci -q add_list dhcp."$cfg".server="$address#$port"
+ uci -q del_list "dhcp.$cfg.server=${address}#${port}"
+ uci -q add_list "dhcp.$cfg.server=${address}#${port}"
}
dnsmasq_create_server_backup() {
@@ -134,7 +136,7 @@ dnsmasq_create_server_backup() {
for i in $(uci -q get "dhcp.$cfg.server"); do
uci -q add_list dhcp."$cfg".doh_backup_server="$i"
if [ "$i" = "${i//127.0.0.1}" ] && [ "$i" = "$(echo "$i" | tr -d /)" ]; then
- uci -q del_list dhcp."$cfg".server="$i"
+ uci -q del_list "dhcp.$cfg.server=$i"
fi
done
}
@@ -145,7 +147,7 @@ dnsmasq_restore_server_backup() {
if uci -q get "dhcp.$cfg.doh_backup_server" >/dev/null; then
uci -q del "dhcp.$cfg.server"
for i in $(uci -q get "dhcp.$cfg.doh_backup_server"); do
- uci -q add_list dhcp."$cfg".server="$i"
+ uci -q add_list "dhcp.$cfg.server=$i"
done
uci -q del "dhcp.$cfg.doh_backup_server"
fi