♻️ refactor(podkop): update WARP detection logic

This commit is contained in:
Ivan K
2025-05-01 18:29:42 +03:00
parent e59ef6dd6f
commit 65f72e1e04

View File

@@ -2234,21 +2234,18 @@ global_check() {
print_global "❌ WAN configuration not found" print_global "❌ WAN configuration not found"
fi fi
local warp_found=0
if uci show network | grep -q endpoint_host; then if uci show network | grep -q endpoint_host; then
uci show network | grep endpoint_host | cut -d'=' -f2 | tr -d "'\" " | while read -r host; do uci show network | grep endpoint_host | cut -d'=' -f2 | tr -d "'\" " | while read -r host; do
if [ "$host" = "engage.cloudflareclient.com" ]; then if [ "$host" = "engage.cloudflareclient.com" ]; then
print_global "⚠️ WARP detected: $host" print_global "⚠️ WARP detected: $host"
warp_found=1
continue continue
fi fi
ip_prefix=$(echo "$host" | cut -d'.' -f1,2) ip_prefix=$(echo "$host" | cut -d'.' -f1,2)
if echo "$CLOUDFLARE_OCTETS" | grep -wq "$ip_prefix"; then if echo "$CLOUDFLARE_OCTETS" | grep -wq "$ip_prefix"; then
print_global "━━━━━━━━━━━━━━━━━━━━━━━━━━━" print_global "━━━━━━━━━━━━━━━━━━━━━━━━━━━"
print_global " WARP DETECTION" print_global " ➡️ WARP DETECTION"
print_global "⚠️ WARP detected: $host" print_global "⚠️ WARP detected: $host"
warp_found=1
fi fi
done done
fi fi