~增加ecs优化功能

This commit is contained in:
juewuy
2026-01-07 20:23:56 +08:00
parent 0a0e5c0af9
commit 1c2474cf9e

View File

@@ -1,10 +1,8 @@
get_ecs_address() { get_ecs_address() {
ip=$(uci get network.wan.dns 2>/dev/null)
[ -n "$ip" ] && return
for f in /tmp/resolv.conf.auto /tmp/resolv.conf /tmp/resolv.conf.d/resolv.conf.auto; do for f in /tmp/resolv.conf.auto /tmp/resolv.conf /tmp/resolv.conf.d/resolv.conf.auto; do
[ -f "$f" ] || continue [ -f "$f" ] || continue
ip=$(grep -A2 "^# Interface wan" "$f" | grep nameserver | awk '{printf "%s ", $2}') ip=$(grep -A1 "^# Interface wan$" "$f" | grep nameserver | awk '{printf "%s ", $2}')
[ -n "$ip" ] && return [ -n "$ip" ] && return
done done
. "$CRASHDIR"/libs/web_get_lite.sh . "$CRASHDIR"/libs/web_get_lite.sh