Update sys_info.sh

This commit is contained in:
StressOzz authored and GitHub committed 2025-11-30 17:25:53 +05:00
1 parent 6567541b9a
commit 00f934987f
1 file changed
+10 -6
+10 -6
View File
@@ -3,6 +3,10 @@ GREEN="\033[1;32m"
RED="\033[1;31m" RED="\033[1;31m"
NC="\033[0m" NC="\033[0m"
CONF="/etc/config/zapret" CONF="/etc/config/zapret"
if ! command -v curl >/dev/null 2>&1; then
echo -e "${CYAN}Устанавливаем ${NC}curl"
opkg update >/dev/null 2>&1 && opkg install curl >/dev/null 2>&1
fi
echo -e "\n${GREEN}===== Информация о системе =====${NC}" echo -e "\n${GREEN}===== Информация о системе =====${NC}"
MODEL=$(cat /tmp/sysinfo/model) MODEL=$(cat /tmp/sysinfo/model)
ARCH=$(sed -n "s/.*ARCH='\(.*\)'/\1/p" /etc/openwrt_release) ARCH=$(sed -n "s/.*ARCH='\(.*\)'/\1/p" /etc/openwrt_release)
@@ -49,14 +53,14 @@ fi
out="$out | FIX: ${dpi}" out="$out | FIX: ${dpi}"
echo -e "$out" echo -e "$out"
echo -e "\n${GREEN}===== Проверка GitHub =====${NC}" echo -e "\n${GREEN}===== Проверка GitHub =====${NC}"
RATE=$(wget -qO- -s https://api.github.com/rate_limit | grep '"remaining"' | head -1 | awk '{print $2}' | tr -d ,) RATE=$(curl -s https://api.github.com/rate_limit | grep '"remaining"' | head -1 | awk '{print $2}' | tr -d ,)
[ -z "$RATE" ] && RATE_OUT="${RED}N/A${NC}" || RATE_OUT=$([ "$RATE" -eq 0 ] && echo -e "${RED}0${NC}" || echo -e "${GREEN}$RATE${NC}") [ -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 "IPv4: " echo -n "IPv4: "
wget -4 --timeout=3 --server-response --spider https://github.com >/dev/null 2>&1 && echo -ne "${GREEN}ok${NC}" || echo -ne "${RED}fail${NC}" curl -4 -Is --connect-timeout 3 https://github.com >/dev/null 2>&1 && echo -ne "${GREEN}ok${NC}" || echo -ne "${RED}fail${NC}"
echo -n " IPv6: " echo -n " IPv6: "
wget -6 --timeout=3 --server-response --spider https://github.com >/dev/null 2>&1 && echo -e "${GREEN}ok${NC}" || echo -e "${RED}fail${NC}" curl -6 -Is --connect-timeout 3 https://github.com >/dev/null 2>&1 && echo -e "${GREEN}ok${NC}" || echo -e "${RED}fail${NC}"
echo -n "API: " echo -n "API: "
wget --timeout=3 --server-response --spider https://api.github.com >/dev/null 2>&1 \ curl -Is --connect-timeout 3 https://api.github.com >/dev/null 2>&1 \
&& echo -e "${GREEN}ok${NC} Limit: $RATE_OUT" \ && echo -e "${GREEN}ok${NC} Limit: $RATE_OUT" \
|| echo -e "${RED}fail${NC} Limit: $RATE_OUT" || echo -e "${RED}fail${NC} Limit: $RATE_OUT"
echo -e "\n${GREEN}===== Настройки Zapret =====${NC}" echo -e "\n${GREEN}===== Настройки Zapret =====${NC}"
@@ -135,13 +139,13 @@ right_idx=$((idx + half))
right=$(echo $sites_list | cut -d' ' -f$right_idx) right=$(echo $sites_list | cut -d' ' -f$right_idx)
left_pad=$(printf "%-25s" "$left") left_pad=$(printf "%-25s" "$left")
right_pad=$(printf "%-25s" "$right") right_pad=$(printf "%-25s" "$right")
if wget --timeout=4 --server-response --spider "https://$left" >/dev/null 2>&1; then if curl -Is --connect-timeout 3 --max-time 4 "https://$left" >/dev/null 2>&1; then
left_color="[${GREEN}OK${NC}] " left_color="[${GREEN}OK${NC}] "
else else
left_color="[${RED}FAIL${NC}]" left_color="[${RED}FAIL${NC}]"
fi fi
if [ -n "$right" ]; then if [ -n "$right" ]; then
if wget --timeout=4 --server-response --spider "https://$right" >/dev/null 2>&1; then if curl -Is --connect-timeout 3 --max-time 4 "https://$right" >/dev/null 2>&1; then
right_color="[${GREEN}OK${NC}] " right_color="[${GREEN}OK${NC}] "
else else
right_color="[${RED}FAIL${NC}]" right_color="[${RED}FAIL${NC}]"