This commit is contained in:
sushen339
2025-11-18 02:52:39 +08:00
parent 4351fc1757
commit 9687a4fd4f
2 changed files with 16 additions and 4 deletions
+12
View File
@@ -110,4 +110,16 @@ bash <(curl -fsSL "https://raw.githubusercontent.com/sushen339/tools/main/nft.sh
bash <(curl -fsSL "https://gh-proxy.com/https://raw.githubusercontent.com/sushen339/tools/main/nft.sh") bash <(curl -fsSL "https://gh-proxy.com/https://raw.githubusercontent.com/sushen339/tools/main/nft.sh")
``` ```
## 8. block-ip.sh —— 基于SSH登陆的IP 封禁脚本
一键运行:
```bash
bash <(curl -fsSL "https://raw.githubusercontent.com/sushen339/tools/main/block-ip.sh")
```
代理加速:
```bash
bash <(curl -fsSL "https://gh-proxy.com/https://raw.githubusercontent.com/sushen339/tools/main/block-ip.sh")
```
> 建议所有脚本以 root 权限运行,详细参数和说明请阅读各脚本头部注释。 > 建议所有脚本以 root 权限运行,详细参数和说明请阅读各脚本头部注释。
+4 -4
View File
@@ -326,13 +326,13 @@ $RAW_V6"
if [ -f "$PERSIST_FILE" ] && [ -s "$PERSIST_FILE" ]; then if [ -f "$PERSIST_FILE" ] && [ -s "$PERSIST_FILE" ]; then
# 从 PERSIST_FILE 提取国家代码并统计 # 从 PERSIST_FILE 提取国家代码并统计
COUNTRY_DATA=$(grep '|' "$PERSIST_FILE" | cut -d'|' -f2) COUNTRY_DATA=$(grep '|' "$PERSIST_FILE" 2>/dev/null | cut -d'|' -f2)
if [ -n "$COUNTRY_DATA" ]; then if [ -n "$COUNTRY_DATA" ]; then
echo "$COUNTRY_DATA" | sort | uniq -c | sort -rn | while read -r count code; do echo "$COUNTRY_DATA" | sort | uniq -c | sort -rn | while read -r count code; do
[ -n "$count" ] && [ -n "$code" ] && { if [ -n "$count" ] && [ -n "$code" ]; then
COUNTRY_NAME=$(get_country_name "$code") COUNTRY_NAME=$(get_country_name "$code")
printf " - %-15s %b(%s 个)%b\n" "$COUNTRY_NAME" "$C_RED" "$count" "$C_RESET" printf " - %-15s \033[31m(%s 个)\033[0m\n" "$COUNTRY_NAME" "$count"
} fi
done done
else else
echo "(暂无国家信息)" echo "(暂无国家信息)"