From 922435d8d6e29dac816da1deb4a87240131824e0 Mon Sep 17 00:00:00 2001 From: fscarmen Date: Sun, 27 Apr 2025 01:52:56 +0000 Subject: [PATCH] Improved WARP status detection method for better accuracy. --- menu.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/menu.sh b/menu.sh index debaec4..d274038 100644 --- a/menu.sh +++ b/menu.sh @@ -1302,7 +1302,7 @@ net() { # WARP 开关,先检查是否已安装,再根据当前状态转向相反状态 onoff() { [ ! -x "$(type -p wg-quick)" ] && error " $(text 155) " - [ -n "$(wg 2>/dev/null)" ] && (wg-quick down warp >/dev/null 2>&1; info " $(text 15) ") || net + wg show warp >/dev/null 2>&1 && (wg-quick down warp >/dev/null 2>&1; info " $(text 15) ") || net } # Client 开关,先检查是否已安装,再根据当前状态转向相反状态 @@ -3151,7 +3151,7 @@ menu_setting() { fi [ -e /etc/dnsmasq.d/warp.conf ] && IPTABLE_INSTALLED="$(text 92)" - [ -n "$(wg 2>/dev/null)" ] && MENU_OPTION[4]="4. $(text 77)" || MENU_OPTION[4]="4. $(text 71)" + wg show warp >/dev/null 2>&1 && MENU_OPTION[4]="4. $(text 77)" || MENU_OPTION[4]="4. $(text 71)" if [ -e /etc/wireguard/warp.conf ]; then grep -q '#Table' /etc/wireguard/warp.conf && GLOBAL_OR_NOT="$(text 184)" || GLOBAL_OR_NOT="$(text 185)" fi