41 lines
1.5 KiB
Bash
41 lines
1.5 KiB
Bash
#!/system/bin/sh
|
|
export PATH="/data/adb/magisk:/data/adb/box/bin:/system/bin:$PATH"
|
|
CFG=/data/adb/box/sing-box/config.json
|
|
YQ=/data/adb/box/bin/yq
|
|
|
|
# Use HTTPS DoH via sidecar (port 443 - TT allows this; TCP/53 often blocked by SOCKS policy)
|
|
# Also try DoH via legacy hysteria outbound as fallback dns-hy2
|
|
"$YQ" -i -o=json '
|
|
.dns.servers = [
|
|
{"type":"https","tag":"dns-remote","detour":"sidecar-proxy","server":"1.1.1.1","path":"/dns-query"},
|
|
{"type":"https","tag":"dns-hy2","detour":"proxy","server":"1.1.1.1","path":"/dns-query"},
|
|
{"type":"udp","tag":"dns-direct","detour":"direct","server":"192.168.0.1"}
|
|
] |
|
|
.dns.rules = [] |
|
|
.dns.final = "dns-remote" |
|
|
.dns.strategy = "ipv4_only" |
|
|
.dns.independent_cache = true |
|
|
.log.level = "debug"
|
|
' "$CFG"
|
|
|
|
# Restart quietly
|
|
sh /data/adb/box/scripts/box.service restart
|
|
sleep 5
|
|
echo "tt=$(pidof trusttunnel_client) sb=$(pidof sing-box)"
|
|
echo "=== dns cfg ==="
|
|
"$YQ" -o=json '.dns.servers,.dns.final,.dns.strategy' "$CFG"
|
|
|
|
# One hostname at a time with pauses
|
|
sleep 2
|
|
echo "=== google ==="
|
|
curl -m 20 -sS -o /dev/null -w "%{http_code} %{time_total}\n" https://www.google.com/ 2>&1 || true
|
|
sleep 2
|
|
echo "=== ya ==="
|
|
curl -m 15 -sS -o /dev/null -w "%{http_code} %{time_total}\n" https://ya.ru/ 2>&1 || true
|
|
sleep 2
|
|
echo "=== github ==="
|
|
curl -m 15 -sS -o /dev/null -w "%{http_code} %{time_total}\n" https://github.com/ 2>&1 || true
|
|
|
|
echo "=== dial/dns debug lines ==="
|
|
grep -iE 'dns-remote|dns:|sidecar|1\.1\.1\.1|exchange' /data/adb/box/run/sing-box.log | tail -40
|