Update 661.sh

This commit is contained in:
甬哥侃侃侃ygkkk 2023-03-11 04:47:32 +00:00
parent 5fa4cd6c91
commit 9ab40c2af2
1 changed files with 43 additions and 29 deletions

72
661.sh
View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export LANG=en_US.UTF-8 export LANG=en_US.UTF-8
wpygV="23.2.18 V 0.4 " wpygV="23.3.7 V 0.8 "
remoteV=`wget -qO- https://gitlab.com/rwkgyg/CFwarp/raw/main/CFwarp.sh | sed -n 4p | cut -d '"' -f 2` remoteV=`wget -qO- https://gitlab.com/rwkgyg/CFwarp/raw/main/CFwarp.sh | sed -n 4p | cut -d '"' -f 2`
chmod +x /root/CFwarp.sh chmod +x /root/CFwarp.sh
red='\033[0;31m' red='\033[0;31m'
@ -48,18 +48,7 @@ op=`sys`
version=`uname -r | awk -F "-" '{print $1}'` version=`uname -r | awk -F "-" '{print $1}'`
main=`uname -r | awk -F . '{print $1}'` main=`uname -r | awk -F . '{print $1}'`
minor=`uname -r | awk -F . '{print $2}'` minor=`uname -r | awk -F . '{print $2}'`
bit=`uname -m`
[[ $bit = aarch64 ]] && cpu=arm64
if [[ $bit = x86_64 ]]; then
cpu=amd64
#amdv=$(cat /proc/cpuinfo | grep flags | head -n 1 | cut -d: -f2)
#case "$amdv" in
#*avx512*) cpu=amd64v4;;
#*avx2*) cpu=amd64v3;;
#*sse3*) cpu=amd64v2;;
#*) cpu=amd64;;
#esac
fi
vi=`systemd-detect-virt` vi=`systemd-detect-virt`
if [[ $vi = openvz ]]; then if [[ $vi = openvz ]]; then
TUN=$(cat /dev/net/tun 2>&1) TUN=$(cat /dev/net/tun 2>&1)
@ -87,6 +76,11 @@ fi
fi fi
fi fi
if [[ ! -f /root/nf || ! -s /root/nf ]]; then if [[ ! -f /root/nf || ! -s /root/nf ]]; then
bit=`uname -m`
[[ $bit = aarch64 ]] && cpu=arm64
if [[ $bit = x86_64 ]]; then
cpu=amd64
fi
wget -O nf https://raw.githubusercontent.com/rkygogo/netflix-verify/main/nf_linux_$cpu wget -O nf https://raw.githubusercontent.com/rkygogo/netflix-verify/main/nf_linux_$cpu
chmod +x nf chmod +x nf
fi fi
@ -95,7 +89,6 @@ fi
[[ $(type -P bc) ]] || ($yumapt update;$yumapt install bc) [[ $(type -P bc) ]] || ($yumapt update;$yumapt install bc)
[[ ! $(type -P qrencode) ]] && ($yumapt update;$yumapt install qrencode) [[ ! $(type -P qrencode) ]] && ($yumapt update;$yumapt install qrencode)
[[ ! $(type -P python3) ]] && (yellow "检测到python3未安装升级安装中" && $yumapt update;$yumapt install python3) [[ ! $(type -P python3) ]] && (yellow "检测到python3未安装升级安装中" && $yumapt update;$yumapt install python3)
[[ ! $(type -P screen) ]] && (yellow "检测到screen未安装升级安装中" && $yumapt update;$yumapt install screen)
} }
v4v6(){ v4v6(){
@ -166,7 +159,7 @@ fi
docker(){ docker(){
if [[ -n $(ip a | grep docker) ]]; then if [[ -n $(ip a | grep docker) ]]; then
red "检测到VPS已安装docker如继续安装WARPdocker可能会失效" red "检测到VPS已安装docker如继续安装WARPdocker会失效"
sleep 3s sleep 3s
yellow "6秒后继续安装退出安装请按Ctrl+c" yellow "6秒后继续安装退出安装请按Ctrl+c"
sleep 6s sleep 6s
@ -245,6 +238,10 @@ systemctl restart warp-go >/dev/null 2>&1
systemctl enable warp-go >/dev/null 2>&1 systemctl enable warp-go >/dev/null 2>&1
systemctl start warp-go >/dev/null 2>&1 systemctl start warp-go >/dev/null 2>&1
red "纯IPV6的VPS目前不支持安装Socks5-WARP" && sleep 2 && bash CFwarp.sh red "纯IPV6的VPS目前不支持安装Socks5-WARP" && sleep 2 && bash CFwarp.sh
else
systemctl restart warp-go >/dev/null 2>&1
systemctl enable warp-go >/dev/null 2>&1
systemctl start warp-go >/dev/null 2>&1
#elif [[ -n $v4 && -z $v6 ]]; then #elif [[ -n $v4 && -z $v6 ]]; then
#systemctl start wg-quick@wgcf >/dev/null 2>&1 #systemctl start wg-quick@wgcf >/dev/null 2>&1
#checkwgcf #checkwgcf
@ -299,7 +296,7 @@ white "-------------------------------------------------------------------------
} }
S5menu(){ S5menu(){
white "------------------------------------------------------------------------------------------------" white "------------------------------------------------------------------------------------------------"
white " 当前Socks5-WARP客户端本地代理情况如下(不支持 纯IPV6)" white " 当前Socks5-WARP客户端本地代理情况如下 (不支持 纯IPV6 VPS)"
blue " ${S5Status}" blue " ${S5Status}"
white "------------------------------------------------------------------------------------------------" white "------------------------------------------------------------------------------------------------"
} }
@ -933,7 +930,7 @@ green "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
yellow " 安装warp成功后进入脚本快捷方式cf" yellow " 安装warp成功后进入脚本快捷方式cf"
white " =================================================================" white " ================================================================="
green " 1. 安装/切换WARP-GO三模式" green " 1. 安装/切换WARP-GO三模式"
[[ $cpu != amd64 ]] && red " 2. 提示当前VPS的CPU并非AMD64架构目前不支持安装Socks5-WARP" || green " 2. 安装Socks5-WARP" [[ $cpu != amd64* ]] && red " 2. 提示当前VPS的CPU并非AMD64架构目前不支持安装Socks5-WARP" || green " 2. 安装Socks5-WARP"
green " 3. 卸载WARP" green " 3. 卸载WARP"
green " 4. 显示WARP代理节点的配置文件、二维码WireGuard协议" green " 4. 显示WARP代理节点的配置文件、二维码WireGuard协议"
white " -----------------------------------------------------------------" white " -----------------------------------------------------------------"
@ -945,15 +942,15 @@ green " 9. 更新WARP-GO内核"
green " 10. 卸载WARP-GO切换为WGCF-WARP内核" green " 10. 卸载WARP-GO切换为WGCF-WARP内核"
green " 0. 退出脚本 " green " 0. 退出脚本 "
red "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" red "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
if [[ $(type -P warp-go) || $(type -P warp-cli) ]] && [[ -f '/root/661.sh' ]]; then
if [ "${wpygV}" = "${remoteV}" ]; then if [ "${wpygV}" = "${remoteV}" ]; then
echo -e " 当前 CFwarp 脚本版本号:${bblue}${wpygV}${plain} 重置版第版 ,已是最新版本\n" echo -e " 当前 CFwarp 脚本版本号:${bblue}${wpygV}${plain} 重置版第版 ,已是最新版本\n"
else else
echo -e " 当前 CFwarp 脚本版本号:${bblue}${wpygV}${plain}" echo -e " 当前 CFwarp 脚本版本号:${bblue}${wpygV}${plain}"
echo -e " 检测到最新 CFwarp 脚本版本号:${yellow}${remoteV}${plain}" echo -e " 检测到最新 CFwarp 脚本版本号:${yellow}${remoteV}${plain}"
echo -e " ${yellow}$(wget -qO- https://gitlab.com/rwkgyg/CFwarp/raw/main/version/warpV)${plain}" echo -e " ${yellow}$(wget -qO- https://gitlab.com/rwkgyg/CFwarp/raw/main/version/warpV)${plain}"
echo -e " 可选择8进行更新\n" echo -e " 可选择8进行更新\n"
fi fi
if [[ $(type -P warp-go) ]] && [[ -f '/root/CFwarp.sh' ]]; then
loVERSION="$(/usr/local/bin/warp-go -v | sed -n 1p | awk '{print $1}' | awk -F"/" '{print $NF}')" loVERSION="$(/usr/local/bin/warp-go -v | sed -n 1p | awk '{print $1}' | awk -F"/" '{print $NF}')"
wgVERSION="$(wget -qO- https://gitlab.com/rwkgyg/CFwarp/raw/main/version/warpgoV)" wgVERSION="$(wget -qO- https://gitlab.com/rwkgyg/CFwarp/raw/main/version/warpgoV)"
if [ "${loVERSION}" = "${wgVERSION}" ]; then if [ "${loVERSION}" = "${wgVERSION}" ]; then
@ -971,7 +968,7 @@ echo
readp " 请输入数字:" Input readp " 请输入数字:" Input
case "$Input" in case "$Input" in
1 ) warpinscha;; 1 ) warpinscha;;
2 ) [[ $cpu = amd64 ]] && SOCKS5ins || bash CFwarp.sh;; 2 ) [[ $cpu = amd64* ]] && SOCKS5ins || bash CFwarp.sh;;
3 ) WARPun && uncf ;; 3 ) WARPun && uncf ;;
4 ) WGproxy;; 4 ) WGproxy;;
5 ) WARPonoff;; 5 ) WARPonoff;;
@ -986,6 +983,18 @@ esac
if [ $# == 0 ]; then if [ $# == 0 ]; then
warpwgcf warpwgcf
start start
bit=`uname -m`
[[ $bit = aarch64 ]] && cpu=arm64
if [[ $bit = x86_64 ]]; then
#cpu=amd64
amdv=$(cat /proc/cpuinfo | grep flags | head -n 1 | cut -d: -f2)
case "$amdv" in
*avx512*) cpu=amd64v4;;
*avx2*) cpu=amd64v3;;
*sse3*) cpu=amd64v2;;
*) cpu=amd64;;
esac
fi
start_menu start_menu
fi fi
} }
@ -1514,7 +1523,7 @@ green "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
yellow " 安装warp成功后进入脚本快捷方式cf" yellow " 安装warp成功后进入脚本快捷方式cf"
white " =================================================================" white " ================================================================="
green " 1. 安装/切换WGCF-WARP三模式" green " 1. 安装/切换WGCF-WARP三模式"
[[ $cpu != amd64 ]] && red " 2. 提示当前VPS的CPU并非AMD64架构目前不支持安装Socks5-WARP" || green " 2. 安装Socks5-WARP" [[ $cpu != amd64* ]] && red " 2. 提示当前VPS的CPU并非AMD64架构目前不支持安装Socks5-WARP" || green " 2. 安装Socks5-WARP"
green " 3. WARP卸载" green " 3. WARP卸载"
green " 4. 显示WARP代理节点的配置文件、二维码WireGuard协议" green " 4. 显示WARP代理节点的配置文件、二维码WireGuard协议"
white " -----------------------------------------------------------------" white " -----------------------------------------------------------------"
@ -1525,11 +1534,11 @@ green " 8. 更新CFwarp安装脚本"
green " 9. 卸载WGCF-WARP切换为WARP-GO内核" green " 9. 卸载WGCF-WARP切换为WARP-GO内核"
green " 0. 退出脚本 " green " 0. 退出脚本 "
red "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" red "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
if [[ $(type -P wg-quick) || $(type -P warp-cli) ]] && [[ -f '/root/661.sh' ]]; then if [[ $(type -P wg-quick) || $(type -P warp-cli) ]] && [[ -f '/root/CFwarp.sh' ]]; then
if [ "${wpygV}" = "${remoteV}" ]; then if [ "${wpygV}" = "${remoteV}" ]; then
echo -e " 当前CFwarp脚本版本号${bblue}${wpygV}${plain} 重置版第版 ,已是最新版本\n" echo -e " 当前 CFwarp 脚本版本号:${bblue}${wpygV}${plain} 重置版第版 ,已是最新版本\n"
else else
echo -e " 当前CFwarp脚本版本号${bblue}${wpygV}${plain}" echo -e " 当前 CFwarp 脚本版本号:${bblue}${wpygV}${plain}"
echo -e " 检测到最新CFwarp脚本版本号${yellow}${remoteV}${plain}" echo -e " 检测到最新CFwarp脚本版本号${yellow}${remoteV}${plain}"
echo -e " ${yellow}$(wget -qO- https://gitlab.com/rwkgyg/CFwarp/raw/main/version/warpV)${plain}" echo -e " ${yellow}$(wget -qO- https://gitlab.com/rwkgyg/CFwarp/raw/main/version/warpV)${plain}"
echo -e " 可选择8进行更新\n" echo -e " 可选择8进行更新\n"
@ -1564,6 +1573,11 @@ fi
if [ $# == 0 ]; then if [ $# == 0 ]; then
warpgo warpgo
start start
bit=`uname -m`
[[ $bit = aarch64 ]] && cpu=arm64
if [[ $bit = x86_64 ]]; then
cpu=amd64
fi
start_menu start_menu
fi fi
} }
@ -1598,15 +1612,15 @@ esac
} }
if [ $# == 0 ]; then if [ $# == 0 ]; then
start start
if [[ -n $(type -P warp-go) ]] && [[ -f '/root/661.sh' ]]; then if [[ -n $(type -P warp-go) ]] && [[ -f '/root/CFwarp.sh' ]]; then
ONEWARPGO ONEWARPGO
elif [[ -n $(type -P warp-go) && -n $(type -P warp-cli) ]] && [[ -f '/root/661.sh' ]]; then elif [[ -n $(type -P warp-go) && -n $(type -P warp-cli) ]] && [[ -f '/root/CFwarp.sh' ]]; then
ONEWARPGO ONEWARPGO
elif [[ -z $(type -P warp-go) && -z $(type -P wg-quick) && -n $(type -P warp-cli) ]] && [[ -f '/root/661.sh' ]]; then elif [[ -z $(type -P warp-go) && -z $(type -P wg-quick) && -n $(type -P warp-cli) ]] && [[ -f '/root/CFwarp.sh' ]]; then
ONEWARPGO ONEWARPGO
elif [[ -n $(type -P wg-quick) ]] && [[ -f '/root/661.sh' ]]; then elif [[ -n $(type -P wg-quick) ]] && [[ -f '/root/CFwarp.sh' ]]; then
ONEWGCFWARP ONEWGCFWARP
elif [[ -n $(type -P wg-quick) && -n $(type -P warp-cli) ]] && [[ -f '/root/661.sh' ]]; then elif [[ -n $(type -P wg-quick) && -n $(type -P warp-cli) ]] && [[ -f '/root/CFwarp.sh' ]]; then
ONEWGCFWARP ONEWGCFWARP
else else
startCFwarp startCFwarp