mirror of
https://github.com/233boy/sing-box.git
synced 2026-05-02 22:04:40 +08:00
fix sb dns
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
args=$@
|
||||
is_sh_ver=v1.14
|
||||
is_sh_ver=v1.15
|
||||
|
||||
. /etc/sing-box/sh/src/init.sh
|
||||
@@ -51,11 +51,11 @@ dns_set() {
|
||||
fi
|
||||
is_dns_use_bak=$is_dns_use
|
||||
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
|
||||
if [[ $is_dns_new ]]; then
|
||||
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
|
||||
cat <<<$(jq '.dns.servers=[{address:"'$is_dns_use'",address_resolver:"local"},{tag:"local",address:"local"}]' $is_config_json) >$is_config_json
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user