mirror of
https://github.com/kenzok8/small-package.git
synced 2026-02-07 23:27:13 +08:00
update-10.22
This commit is contained in:
@@ -521,9 +521,9 @@ function action_rule_mode()
|
||||
local cn_port = cn_port()
|
||||
if not daip or not cn_port then return end
|
||||
info = json.parse(luci.sys.exec(string.format('curl -sL -m 3 -H "Content-Type: application/json" -H "Authorization: Bearer %s" -XGET http://"%s":"%s"/configs', dase, daip, cn_port)))
|
||||
mode = info["mode"]
|
||||
mode = info["mode"] or "rule"
|
||||
else
|
||||
mode = uci:get("openclash", "config", "proxy_mode") or "info"
|
||||
mode = uci:get("openclash", "config", "proxy_mode") or "rule"
|
||||
end
|
||||
luci.http.prepare_content("application/json")
|
||||
luci.http.write_json({
|
||||
@@ -591,7 +591,7 @@ function action_log_level()
|
||||
local cn_port = cn_port()
|
||||
if not daip or not cn_port then return end
|
||||
info = json.parse(luci.sys.exec(string.format('curl -sL -m 3 -H "Content-Type: application/json" -H "Authorization: Bearer %s" -XGET http://"%s":"%s"/configs', dase, daip, cn_port)))
|
||||
level = info["log-level"]
|
||||
level = info["log-level"] or "info"
|
||||
else
|
||||
level = uci:get("openclash", "config", "log_level") or "info"
|
||||
end
|
||||
|
||||
@@ -74,47 +74,47 @@ config dns_servers
|
||||
|
||||
config dns_servers
|
||||
option type 'https'
|
||||
option group 'fallback'
|
||||
option enabled '1'
|
||||
option ip 'doh.pub/dns-query'
|
||||
option group 'fallback'
|
||||
option enabled '1'
|
||||
|
||||
config dns_servers
|
||||
option type 'https'
|
||||
option group 'fallback'
|
||||
option enabled '1'
|
||||
option ip 'dns.alidns.com/dns-query'
|
||||
option group 'fallback'
|
||||
option enabled '1'
|
||||
|
||||
config dns_servers
|
||||
option type 'https'
|
||||
option group 'fallback'
|
||||
option enabled '1'
|
||||
option ip 'cloudflare-dns.com/dns-query'
|
||||
option enabled '1'
|
||||
|
||||
config dns_servers
|
||||
option group 'fallback'
|
||||
option enabled '1'
|
||||
option ip 'dns.rubyfish.cn/dns-query'
|
||||
option type 'https'
|
||||
option enabled '1'
|
||||
|
||||
config dns_servers
|
||||
option enabled '0'
|
||||
option group 'fallback'
|
||||
option ip 'dns.google'
|
||||
option port '853'
|
||||
option type 'tls'
|
||||
option enabled '0'
|
||||
|
||||
config dns_servers
|
||||
option enabled '0'
|
||||
option group 'fallback'
|
||||
option type 'https'
|
||||
option ip '1.1.1.1/dns-query'
|
||||
option enabled '0'
|
||||
|
||||
config dns_servers
|
||||
option enabled '0'
|
||||
option group 'fallback'
|
||||
option ip '1.1.1.1'
|
||||
option port '853'
|
||||
option type 'tls'
|
||||
option enabled '0'
|
||||
|
||||
config dns_servers
|
||||
option enabled '0'
|
||||
@@ -124,15 +124,22 @@ config dns_servers
|
||||
option type 'tls'
|
||||
|
||||
config dns_servers
|
||||
option enabled '0'
|
||||
option type 'udp'
|
||||
option group 'fallback'
|
||||
option ip '2001:4860:4860::8888'
|
||||
option port '53'
|
||||
option enabled '0'
|
||||
|
||||
config dns_servers
|
||||
option enabled '0'
|
||||
option type 'udp'
|
||||
option group 'fallback'
|
||||
option ip '2001:4860:4860::8844'
|
||||
option port '53'
|
||||
option enabled '0'
|
||||
|
||||
config dns_servers
|
||||
option type 'udp'
|
||||
option group 'fallback'
|
||||
option ip '2001:da8::666'
|
||||
option port '53'
|
||||
option enabled '1'
|
||||
@@ -981,12 +981,12 @@ check_run_quick()
|
||||
else
|
||||
if [ -s "/tmp/openclash.change" ]; then
|
||||
for i in $check_file; do
|
||||
if [ -z "$(grep "$i $(date -r $i)" "/tmp/openclash.change")" ]; then
|
||||
if [ -z "$(grep "$i $(date -r $i)$" "/tmp/openclash.change")" ]; then
|
||||
LOG_OUT "Tip: Because of the file【 $i 】modificated, Pause quick start..."
|
||||
quick_start=false
|
||||
break
|
||||
fi
|
||||
done
|
||||
done 2>/dev/null
|
||||
fi
|
||||
fi
|
||||
}
|
||||
@@ -998,7 +998,7 @@ write_run_quick()
|
||||
: > "/tmp/openclash.change"
|
||||
for i in $check_file; do
|
||||
echo "$i $(date -r $i)" >> "/tmp/openclash.change"
|
||||
done
|
||||
done 2>/dev/null
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
@@ -232,9 +232,11 @@ change_dns()
|
||||
uci commit dhcp
|
||||
/etc/init.d/dnsmasq restart >/dev/null 2>&1
|
||||
fi
|
||||
iptables -t nat -D OUTPUT -j openclash_output >/dev/null 2>&1
|
||||
iptables -t mangle -D OUTPUT -j openclash_output >/dev/null 2>&1
|
||||
iptables -t nat -I OUTPUT -j openclash_output >/dev/null 2>&1
|
||||
iptables -t mangle -I OUTPUT -j openclash_output >/dev/null 2>&1
|
||||
nohup /usr/share/openclash/openclash_watchdog.sh &
|
||||
[ "$(unify_ps_status "openclash_watchdog.sh")" -eq 0 ] && [ "$(unify_ps_prevent)" -eq 0 ] && nohup /usr/share/openclash/openclash_watchdog.sh &
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
@@ -618,6 +618,7 @@ EOF
|
||||
fi
|
||||
if [ ! -z "$grpc_service_name" ]; then
|
||||
cat >> "$SERVER_FILE" <<-EOF
|
||||
network: grpc
|
||||
grpc-opts:
|
||||
grpc-service-name: "$grpc_service_name"
|
||||
EOF
|
||||
@@ -625,6 +626,7 @@ EOF
|
||||
if [ "$obfs_trojan" = "ws" ]; then
|
||||
if [ -n "$trojan_ws_path" ] || [ -n "$trojan_ws_headers" ]; then
|
||||
cat >> "$SERVER_FILE" <<-EOF
|
||||
network: ws
|
||||
ws-opts:
|
||||
EOF
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user