From 717e2df921b78c84e044fd1ecc1714f1e634e305 Mon Sep 17 00:00:00 2001 From: StressOzz <131419324+StressOzz@users.noreply.github.com> Date: Mon, 22 Dec 2025 17:50:46 +0500 Subject: [PATCH] Add ping checks for Google IPv4 and IPv6 --- sys_info.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys_info.sh b/sys_info.sh index 285a3db..a982d45 100644 --- a/sys_info.sh +++ b/sys_info.sh @@ -24,8 +24,10 @@ RATE=$(curl -s https://api.github.com/rate_limit | grep '"remaining"' | head -1 [ -z "$RATE" ] && RATE_OUT="${RED}N/A${NC}" || RATE_OUT=$([ "$RATE" -eq 0 ] && echo -e "${RED}0${NC}" || echo -e "${GREEN}$RATE${NC}") echo -n "API: "; curl -Is --connect-timeout 3 https://api.github.com >/dev/null 2>&1 && echo -e "${GREEN}ok${NC} | Limit: $RATE_OUT" || echo -e "${RED}fail${NC} | Limit: $RATE_OUT"; fi echo -e "\n${GREEN}===== Проверка IPv4 / IPv6 =====${NC}" -echo -n "IPv4: "; curl -4 -Is --connect-timeout 3 https://google.com >/dev/null 2>&1 && echo -ne "${GREEN}ok${NC}" || echo -ne "${RED}fail${NC}" -echo -n " | IPv6: "; curl -6 -Is --connect-timeout 3 https://google.com >/dev/null 2>&1 && echo -e "${GREEN}ok${NC}" || echo -e "${RED}fail${NC}" +echo -n "Google IPv4: "; time=$(ping -4 -c 1 -W 2 google.com 2>/dev/null | grep 'time=' | awk -F'time=' '{print $2}' | awk '{print $1}') +if [ -n "$time" ]; then echo -e "${GREEN}ok ($time ms)${NC}"; else echo -e "${RED}fail${NC}"; fi +echo -n "Google IPv6: "; time=$(ping -6 -c 1 -W 2 google.com 2>/dev/null | grep 'time=' | awk -F'time=' '{print $2}' | awk '{print $1}') +if [ -n "$time" ]; then echo -e "${GREEN}ok ($time ms)${NC}"; else echo -e "${RED}fail${NC}"; fi echo -e "\n${GREEN}===== Настройки Zapret =====${NC}" zpr_info() { INSTALLED_VER=$(opkg list-installed | grep '^zapret ' | awk '{print $3}') if /etc/init.d/zapret status 2>/dev/null | grep -qi "running"; then ZAPRET_STATUS="${GREEN}запущен${NC}"