mirror of https://gitlab.com/rwkgyg/CFwarp.git
Update 661.sh
This commit is contained in:
parent
e1b88b9e03
commit
34c8a1d0cb
66
661.sh
66
661.sh
|
@ -165,7 +165,7 @@ wgcfv4=$(curl -s4m6 https://www.cloudflare.com/cdn-cgi/trace -k | grep warp | cu
|
||||||
|
|
||||||
|
|
||||||
warpip(){
|
warpip(){
|
||||||
checkpt(){
|
checkpt2(){
|
||||||
a=`cat /root/warpip/result.csv | awk -F, '$3!="timeout ms" {print} ' | sed -n '2p' | awk -F ',' '{print $2}'`
|
a=`cat /root/warpip/result.csv | awk -F, '$3!="timeout ms" {print} ' | sed -n '2p' | awk -F ',' '{print $2}'`
|
||||||
if [[ $a = 100.00% ]]; then
|
if [[ $a = 100.00% ]]; then
|
||||||
v4v6
|
v4v6
|
||||||
|
@ -179,6 +179,7 @@ export endpoint=`cat /root/warpip/result.csv | awk -F, '$3!="timeout ms" {print}
|
||||||
fi
|
fi
|
||||||
green "脚本将自动应用本地VPS优选的warp对端IP地址:$endpoint"
|
green "脚本将自动应用本地VPS优选的warp对端IP地址:$endpoint"
|
||||||
}
|
}
|
||||||
|
checkpt1(){
|
||||||
mkdir -p /root/warpip
|
mkdir -p /root/warpip
|
||||||
if [[ ! -f '/root/warpip/result.csv' ]]; then
|
if [[ ! -f '/root/warpip/result.csv' ]]; then
|
||||||
cpujg
|
cpujg
|
||||||
|
@ -325,21 +326,23 @@ cd /root/warpip
|
||||||
./$cpu >/dev/null 2>&1 &
|
./$cpu >/dev/null 2>&1 &
|
||||||
wait
|
wait
|
||||||
cd
|
cd
|
||||||
checkpt
|
checkpt2
|
||||||
else
|
else
|
||||||
|
checkpt2
|
||||||
|
fi
|
||||||
|
}
|
||||||
checkwgcf
|
checkwgcf
|
||||||
if [[ ! $wgcfv4 =~ on|plus && ! $wgcfv6 =~ on|plus ]]; then
|
if [[ ! $wgcfv4 =~ on|plus && ! $wgcfv6 =~ on|plus ]]; then
|
||||||
checkpt
|
checkpt1
|
||||||
else
|
else
|
||||||
systemctl stop wg-quick@wgcf >/dev/null 2>&1
|
systemctl stop wg-quick@wgcf >/dev/null 2>&1
|
||||||
kill -15 $(pgrep warp-go) >/dev/null 2>&1 && sleep 2
|
kill -15 $(pgrep warp-go) >/dev/null 2>&1 && sleep 2
|
||||||
checkpt
|
checkpt1
|
||||||
systemctl start wg-quick@wgcf >/dev/null 2>&1
|
systemctl start wg-quick@wgcf >/dev/null 2>&1
|
||||||
systemctl restart warp-go >/dev/null 2>&1
|
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
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
warpip
|
warpip
|
||||||
|
|
||||||
|
@ -430,6 +433,14 @@ ln -sf /root/CFwarp.sh /usr/bin/cf
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
warprefresh(){
|
||||||
|
wget -N https://gitlab.com/rwkgyg/CFwarp/raw/main/wp-plus.py
|
||||||
|
sed -i "27 s/[(][^)]*[)]//g" wp-plus.py
|
||||||
|
readp "客户端配置ID(36个字符):" ID
|
||||||
|
sed -i "27 s/input/'$ID'/" wp-plus.py
|
||||||
|
python3 wp-plus.py
|
||||||
|
}
|
||||||
|
|
||||||
ShowSOCKS5(){
|
ShowSOCKS5(){
|
||||||
if [[ $(systemctl is-active warp-svc) = active ]]; then
|
if [[ $(systemctl is-active warp-svc) = active ]]; then
|
||||||
mport=`warp-cli --accept-tos settings 2>/dev/null | grep 'WarpProxy on port' | awk -F "port " '{print $2}'`
|
mport=`warp-cli --accept-tos settings 2>/dev/null | grep 'WarpProxy on port' | awk -F "port " '{print $2}'`
|
||||||
|
@ -569,12 +580,6 @@ systemctl restart warp-go ; bash CFwarp.sh
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
warpwgcf(){
|
|
||||||
if [[ -e "/usr/local/bin/wgcf" ]]; then
|
|
||||||
red "请先卸载已安装的WGCF-WARP,否则无法安装当前的WARP-GO,脚本退出" && exit
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
ShowWGCF(){
|
ShowWGCF(){
|
||||||
UA_Browser="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.87 Safari/537.36"
|
UA_Browser="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.87 Safari/537.36"
|
||||||
v4v6
|
v4v6
|
||||||
|
@ -653,7 +658,7 @@ red "遗憾!warp的IP获取失败"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
if [[ ! $wgcfv4 =~ on|plus && ! $wgcfv6 =~ on|plus ]]; then
|
if [[ ! $wgcfv4 =~ on|plus && ! $wgcfv6 =~ on|plus ]]; then
|
||||||
yellow "安装WARP失败,还原VPS,卸载WARP"
|
red "安装WARP失败,还原VPS,卸载WARP"
|
||||||
cwg && rm -rf /root/warpip
|
cwg && rm -rf /root/warpip
|
||||||
echo
|
echo
|
||||||
[[ $release = Centos && ${vsid} -lt 7 ]] && yellow "当前系统版本号:Centos $vsid \n建议使用 Centos 7 以上系统 "
|
[[ $release = Centos && ${vsid} -lt 7 ]] && yellow "当前系统版本号:Centos $vsid \n建议使用 Centos 7 以上系统 "
|
||||||
|
@ -927,14 +932,6 @@ fi
|
||||||
echo
|
echo
|
||||||
}
|
}
|
||||||
|
|
||||||
warprefresh(){
|
|
||||||
wget -N https://gitlab.com/rwkgyg/CFwarp/raw/main/wp-plus.py
|
|
||||||
sed -i "27 s/[(][^)]*[)]//g" wp-plus.py
|
|
||||||
readp "客户端配置ID(36个字符):" ID
|
|
||||||
sed -i "27 s/input/'$ID'/" wp-plus.py
|
|
||||||
python3 wp-plus.py
|
|
||||||
}
|
|
||||||
|
|
||||||
WARPup(){
|
WARPup(){
|
||||||
endpost(){
|
endpost(){
|
||||||
kill -15 $(pgrep warp-go) >/dev/null 2>&1 && sleep 2
|
kill -15 $(pgrep warp-go) >/dev/null 2>&1 && sleep 2
|
||||||
|
@ -1211,7 +1208,6 @@ case "$Input" in
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
if [ $# == 0 ]; then
|
if [ $# == 0 ]; then
|
||||||
warpwgcf
|
|
||||||
bit=`uname -m`
|
bit=`uname -m`
|
||||||
[[ $bit = aarch64 ]] && cpu=arm64
|
[[ $bit = aarch64 ]] && cpu=arm64
|
||||||
if [[ $bit = x86_64 ]]; then
|
if [[ $bit = x86_64 ]]; then
|
||||||
|
@ -1464,7 +1460,7 @@ checkwgcf
|
||||||
done
|
done
|
||||||
checkwgcf
|
checkwgcf
|
||||||
if [[ ! $wgcfv4 =~ on|plus && ! $wgcfv6 =~ on|plus ]]; then
|
if [[ ! $wgcfv4 =~ on|plus && ! $wgcfv6 =~ on|plus ]]; then
|
||||||
yellow "安装WARP失败,还原VPS,卸载Wgcf-WARP组件中……"
|
red "安装WARP失败,还原VPS,卸载Wgcf-WARP组件中……"
|
||||||
cwg && rm -rf /root/warpip
|
cwg && rm -rf /root/warpip
|
||||||
echo
|
echo
|
||||||
[[ $release = Centos && ${vsid} -lt 7 ]] && yellow "当前系统版本号:Centos $vsid \n建议使用 Centos 7 以上系统 "
|
[[ $release = Centos && ${vsid} -lt 7 ]] && yellow "当前系统版本号:Centos $vsid \n建议使用 Centos 7 以上系统 "
|
||||||
|
@ -1572,18 +1568,10 @@ systemctl enable wg-quick@wgcf >/dev/null 2>&1
|
||||||
CheckWARP && ShowWGCF && WGCFmenu && lncf && reswarp
|
CheckWARP && ShowWGCF && WGCFmenu && lncf && reswarp
|
||||||
}
|
}
|
||||||
|
|
||||||
warprefresh(){
|
|
||||||
wget -N https://gitlab.com/rwkgyg/CFwarp/raw/main/wp-plus.py
|
|
||||||
sed -i "27 s/[(][^)]*[)]//g" wp-plus.py
|
|
||||||
readp "客户端配置ID(36个字符):" ID
|
|
||||||
sed -i "27 s/input/'$ID'/" wp-plus.py
|
|
||||||
python3 wp-plus.py
|
|
||||||
}
|
|
||||||
|
|
||||||
WARPup(){
|
WARPup(){
|
||||||
[[ ! $(type -P wg-quick) ]] && red "未安装wgcf-warp,安装好wgcf-warp才能执行" && sleep 3 && bash CFwarp.sh
|
[[ ! $(type -P wg-quick) ]] && red "未安装wgcf-warp,安装好wgcf-warp才能执行" && sleep 3 && bash CFwarp.sh
|
||||||
backconf(){
|
backconf(){
|
||||||
yellow "升级失败,自动恢复warp普通账户"
|
red "升级失败,自动恢复warp普通账户"
|
||||||
sed -i "2s#.*#$(sed -ne 2p /etc/wireguard/wgcf-profile.conf)#;4s#.*#$(sed -ne 4p /etc/wireguard/wgcf-profile.conf)#" /etc/wireguard/wgcf.conf
|
sed -i "2s#.*#$(sed -ne 2p /etc/wireguard/wgcf-profile.conf)#;4s#.*#$(sed -ne 4p /etc/wireguard/wgcf-profile.conf)#" /etc/wireguard/wgcf.conf
|
||||||
CheckWARP && ShowWGCF && WGCFmenu
|
CheckWARP && ShowWGCF && WGCFmenu
|
||||||
}
|
}
|
||||||
|
@ -1591,6 +1579,7 @@ ab="1.Teams账户\n2.warp+账户\n3.普通warp账户\n0.返回上一层\n 请选
|
||||||
readp "$ab" cd
|
readp "$ab" cd
|
||||||
case "$cd" in
|
case "$cd" in
|
||||||
1 )
|
1 )
|
||||||
|
red "建议使用warp-go的方案可大概率直接获取Teams团队账户,无需提取参数升级"
|
||||||
[[ ! -e /etc/wireguard/wgcf.conf ]] && red "无法找到wgcf-warp配置文件,建议重装wgcf-warp" && bash CFwarp.sh
|
[[ ! -e /etc/wireguard/wgcf.conf ]] && red "无法找到wgcf-warp配置文件,建议重装wgcf-warp" && bash CFwarp.sh
|
||||||
readp "请复制privateKey(44个字符):" Key
|
readp "请复制privateKey(44个字符):" Key
|
||||||
readp "请复制IPV6的Address:" Add
|
readp "请复制IPV6的Address:" Add
|
||||||
|
@ -1767,14 +1756,7 @@ case "$Input" in
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
warpgo(){
|
|
||||||
if [[ -n $(type -P warp-go) ]]; then
|
|
||||||
red "请先卸载已安装的WARP-GO,否则无法安装当前的WGCF-WARP,脚本退出" && exit
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
if [ $# == 0 ]; then
|
if [ $# == 0 ]; then
|
||||||
warpgo
|
|
||||||
cpujg
|
cpujg
|
||||||
start_menu
|
start_menu
|
||||||
fi
|
fi
|
||||||
|
@ -1811,15 +1793,15 @@ case "$Input" in
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
if [ $# == 0 ]; then
|
if [ $# == 0 ]; then
|
||||||
if [[ -n $(type -P warp-go) ]] && [[ -f '/root/CFwarp.sh' ]]; then
|
if [[ -n $(type -P warp-go) && -z $(type -P wg-quick) ]] && [[ -f '/root/CFwarp.sh' ]]; then
|
||||||
ONEWARPGO
|
ONEWARPGO
|
||||||
elif [[ -n $(type -P warp-go) && -n $(type -P warp-cli) ]] && [[ -f '/root/CFwarp.sh' ]]; then
|
elif [[ -n $(type -P warp-go) && -n $(type -P warp-cli) && -z $(type -P wg-quick) ]] && [[ -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/CFwarp.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/CFwarp.sh' ]]; then
|
elif [[ -n $(type -P wg-quick) && -z $(type -P warp-go) ]] && [[ -f '/root/CFwarp.sh' ]]; then
|
||||||
ONEWGCFWARP
|
ONEWGCFWARP
|
||||||
elif [[ -n $(type -P wg-quick) && -n $(type -P warp-cli) ]] && [[ -f '/root/CFwarp.sh' ]]; then
|
elif [[ -n $(type -P wg-quick) && -n $(type -P warp-cli) && -z $(type -P warp-go) ]] && [[ -f '/root/CFwarp.sh' ]]; then
|
||||||
ONEWGCFWARP
|
ONEWGCFWARP
|
||||||
else
|
else
|
||||||
startCFwarp
|
startCFwarp
|
||||||
|
|
Loading…
Reference in New Issue