From 145605d5fd74807403637349bc432ee5c48fafd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=94=AC=E5=93=A5=E4=BE=83=E4=BE=83=E4=BE=83ygkkk?= Date: Mon, 1 Aug 2022 08:06:11 +0000 Subject: [PATCH] Add new file --- warp-ip1 | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 warp-ip1 diff --git a/warp-ip1 b/warp-ip1 new file mode 100644 index 0000000..8839a07 --- /dev/null +++ b/warp-ip1 @@ -0,0 +1,62 @@ +#!/bin/bash +sleep 5 +green(){ echo -e "\033[32m\033[01m$1\033[0m";} +yellow(){ echo -e "\033[33m\033[01m$1\033[0m";} + +info(){ +v4=$(curl -s4m3 https://ip.gs -k) +v4d=$(curl -s4m3 https://ip.gs -k | awk -F '.' '{print $1}') +} + +BEndpoint(){ +grep Endpoint /etc/wireguard/wgcf.conf +if [[ -n $(grep -w 162.159.192.1 /etc/wireguard/wgcf.conf) ]]; then +sed -i "s/162.159.192.1/162.159.192.2/g" /etc/wireguard/wgcf.conf +elif [[ -n $(grep -w 162.159.192.2 /etc/wireguard/wgcf.conf) ]]; then +sed -i "s/162.159.192.2/162.159.192.3/g" /etc/wireguard/wgcf.conf +elif [[ -n $(grep -w 162.159.192.3 /etc/wireguard/wgcf.conf) ]]; then +sed -i "s/162.159.192.3/162.159.192.4/g" /etc/wireguard/wgcf.conf +elif [[ -n $(grep -w 162.159.192.4 /etc/wireguard/wgcf.conf) ]]; then +sed -i "s/162.159.192.4/162.159.192.5/g" /etc/wireguard/wgcf.conf +elif [[ -n $(grep -w 162.159.192.5 /etc/wireguard/wgcf.conf) ]]; then +sed -i "s/162.159.192.5/162.159.192.6/g" /etc/wireguard/wgcf.conf +elif [[ -n $(grep -w 162.159.192.6 /etc/wireguard/wgcf.conf) ]]; then +sed -i "s/162.159.192.6/162.159.192.7/g" /etc/wireguard/wgcf.conf +elif [[ -n $(grep -w 162.159.192.7 /etc/wireguard/wgcf.conf) ]]; then +sed -i "s/162.159.192.7/162.159.192.8/g" /etc/wireguard/wgcf.conf +elif [[ -n $(grep -w 162.159.192.8 /etc/wireguard/wgcf.conf) ]]; then +sed -i "s/162.159.192.8/162.159.192.9/g" /etc/wireguard/wgcf.conf +elif [[ -n $(grep -w 162.159.192.9 /etc/wireguard/wgcf.conf) ]]; then +sed -i "s/162.159.192.9/162.159.193.10/g" /etc/wireguard/wgcf.conf +elif [[ -n $(grep -w 162.159.193.10 /etc/wireguard/wgcf.conf) ]]; then +sed -i "s/162.159.193.10/162.159.192.1/g" /etc/wireguard/wgcf.conf +fi +if [[ -n $(grep -w 162.159.193.1 /etc/wireguard/wgcf.conf) ]]; then +sed -i "s/162.159.193.1/162.159.193.2/g" /etc/wireguard/wgcf.conf +elif [[ -n $(grep -w 162.159.193.2 /etc/wireguard/wgcf.conf) ]]; then +sed -i "s/162.159.193.2/162.159.193.3/g" /etc/wireguard/wgcf.conf +elif [[ -n $(grep -w 162.159.193.3 /etc/wireguard/wgcf.conf) ]]; then +sed -i "s/162.159.193.3/162.159.193.4/g" /etc/wireguard/wgcf.conf +elif [[ -n $(grep -w 162.159.193.4 /etc/wireguard/wgcf.conf) ]]; then +sed -i "s/162.159.193.4/162.159.193.5/g" /etc/wireguard/wgcf.conf +elif [[ -n $(grep -w 162.159.193.5 /etc/wireguard/wgcf.conf) ]]; then +sed -i "s/162.159.193.5/162.159.193.6/g" /etc/wireguard/wgcf.conf +elif [[ -n $(grep -w 162.159.193.6 /etc/wireguard/wgcf.conf) ]]; then +sed -i "s/162.159.193.6/162.159.193.7/g" /etc/wireguard/wgcf.conf +elif [[ -n $(grep -w 162.159.193.7 /etc/wireguard/wgcf.conf) ]]; then +sed -i "s/162.159.193.7/162.159.193.8/g" /etc/wireguard/wgcf.conf +elif [[ -n $(grep -w 162.159.193.8 /etc/wireguard/wgcf.conf) ]]; then +sed -i "s/162.159.193.8/162.159.193.9/g" /etc/wireguard/wgcf.conf +elif [[ -n $(grep -w 162.159.193.9 /etc/wireguard/wgcf.conf) ]]; then +sed -i "s/162.159.193.9/162.159.193.1/g" /etc/wireguard/wgcf.conf +fi +systemctl restart wg-quick@wgcf +} + +WGCFV4(){ +while true; do +info +[[ "$v4d" = "ipd" ]] && green "恭喜!目前wgcf-ipv4的IP为($v4),设置的IP段为ipd,下轮检测将在你设置的60秒后自动执行" && sleep 60s || (BEndpoint && yellow "遗憾!目前wgcf-ipv4的IP($v4),设置的IP段头为ipd,下轮检测将在你设置的20秒后自动执行" && sleep 20s) +done +} +green "开始刷wgcf-ipv4的IP,你设置的IP段头为ipd" && WGCFV4