Update endip.sh

This commit is contained in:
甬哥侃侃侃ygkkk 2023-05-21 03:29:43 +00:00
parent 600e73a134
commit 5b3ec60a59
1 changed files with 43 additions and 27 deletions

View File

@ -1,6 +1,5 @@
#!/bin/bash #!/bin/bash
warpcheck(){
case "$(uname -m)" in case "$(uname -m)" in
x86_64 | x64 | amd64 ) x86_64 | x64 | amd64 )
cpu=amd64 cpu=amd64
@ -19,14 +18,33 @@ case "$(uname -m)" in
exit exit
;; ;;
esac esac
cfwarpreg(){
curl -sSL https://gitlab.com/rwkgyg/CFwarp/-/raw/main//point/acwarp.sh -o acwarp.sh && chmod +x acwarp.sh && ./acwarp.sh
}
warpendipv4v6(){
echo "1.IPV4优选对端IP"
echo "2.IPV6优选对端IP"
echo "0.退出"
read -p "请选择: " menu
if [ "$menu" == "1" ];then
cfwarpIP && endipv4 && endipresult
elif [ "$menu" == "2" ];then
cfwarpIP && endipv6 && endipresult
else
exit
fi
}
cfwarpIP(){
echo "下载warp优选程序"
if [[ -n $cpu ]]; then if [[ -n $cpu ]]; then
curl -L -o warpendpoint -# --retry 2 https://proxy.freecdn.ml?url=https://gitlab.com/rwkgyg/CFwarp/raw/main/point/$cpu curl -L -o warpendpoint -# --retry 2 https://proxy.freecdn.ml?url=https://gitlab.com/rwkgyg/CFwarp/raw/main/point/$cpu
fi fi
} }
cfwarp(){ endipv4(){
if [ $menu == 1 ]
then
n=0 n=0
iplist=100 iplist=100
while true while true
@ -126,7 +144,9 @@ then
n=$[$n+1] n=$[$n+1]
fi fi
done done
else }
endipv6(){
n=0 n=0
iplist=100 iplist=100
while true while true
@ -161,7 +181,9 @@ else
n=$[$n+1] n=$[$n+1]
fi fi
done done
fi }
endipresult(){
echo ${temp[@]} | sed -e 's/ /\n/g' | sort -u > ip.txt echo ${temp[@]} | sed -e 's/ /\n/g' | sort -u > ip.txt
ulimit -n 102400 ulimit -n 102400
chmod +x warpendpoint chmod +x warpendpoint
@ -172,27 +194,21 @@ rm -rf ip.txt warpendpoint
exit exit
} }
list(){ echo "------------------------------------------------------"
clear echo "甬哥Github项目 github.com/yonggekkk"
echo "WARP-Endpoint优选IP感谢CF网友开发" echo "甬哥blogger博客 ygkkk.blogspot.com"
echo "1.WARP-V4优选" echo "甬哥YouTube频道 www.youtube.com/@ygkkk"
echo "2.WARP-V6优选" echo "脚本支持WARP优选IP、WARP配置文件生成感谢CF网友开发"
echo -e "0.退出\n" echo "------------------------------------------------------"
read -p "请选择菜单(默认1): " menu echo
if [ -z "$menu" ] || [ $menu == "1" ];then echo "1.WARP-V4V6优选对端IP"
menu=1 echo "2.三模式生成WARP配置文件"
cfwarp echo "0.退出"
elif [ $menu == "2" ];then read -p "请选择: " menu
menu=2 if [ "$menu" == "1" ];then
cfwarp warpendipv4v6
elif [ "$menu" == "2" ];then
cfwarpreg
else else
exit exit
fi fi
}
if [ ! -f "warpendpoint" ]; then
echo "下载warp优选程序"
warpcheck && list
else
list
fi