mirror of
https://github.com/233boy/sing-box.git
synced 2026-05-03 06:14:41 +08:00
fix sb dns
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
args=$@
|
args=$@
|
||||||
is_sh_ver=v1.14
|
is_sh_ver=v1.15
|
||||||
|
|
||||||
. /etc/sing-box/sh/src/init.sh
|
. /etc/sing-box/sh/src/init.sh
|
||||||
@@ -51,11 +51,11 @@ dns_set() {
|
|||||||
fi
|
fi
|
||||||
is_dns_use_bak=$is_dns_use
|
is_dns_use_bak=$is_dns_use
|
||||||
if [[ $is_dns_use == "none" ]]; then
|
if [[ $is_dns_use == "none" ]]; then
|
||||||
cat <<<$(jq '.dns={}' $is_config_json) >$is_config_json
|
cat <<<$(jq '.|.dns={}|del(.route.default_domain_resolver)' $is_config_json) >$is_config_json
|
||||||
else
|
else
|
||||||
if [[ $is_dns_new ]]; then
|
if [[ $is_dns_new ]]; then
|
||||||
dns_set_server $is_dns_use
|
dns_set_server $is_dns_use
|
||||||
cat <<<$(jq '.dns.servers=[{type:"'$is_dns_type'",server:"'$is_dns_use'",domain_resolver:"local"},{tag:"local",type:"local"}]' $is_config_json) >$is_config_json
|
cat <<<$(jq '.|.dns.servers=[{tag:"dns",type:"'$is_dns_type'",server:"'$is_dns_use'",domain_resolver:"local"},{tag:"local",type:"local"}]|.route.default_domain_resolver="dns"' $is_config_json) >$is_config_json
|
||||||
else
|
else
|
||||||
cat <<<$(jq '.dns.servers=[{address:"'$is_dns_use'",address_resolver:"local"},{tag:"local",address:"local"}]' $is_config_json) >$is_config_json
|
cat <<<$(jq '.dns.servers=[{address:"'$is_dns_use'",address_resolver:"local"},{tag:"local",address:"local"}]' $is_config_json) >$is_config_json
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user