mirror of https://gitlab.com/rwkgyg/CFwarp.git
Update CFwarp.sh
This commit is contained in:
parent
0074ef4c74
commit
60034c0757
14
CFwarp.sh
14
CFwarp.sh
|
@ -525,7 +525,7 @@ fi
|
||||||
}
|
}
|
||||||
|
|
||||||
WARPtools(){
|
WARPtools(){
|
||||||
green "1. 查看WARP在线监测情况(注意,退出命令:ctrl+a+d )"
|
green "1. 查看WARP在线监测情况(注意!!!退出且继续监测命令:ctrl+a+d,退出且关闭监测命令:ctrl+c )"
|
||||||
green "2. 重启WARP在线监测功能"
|
green "2. 重启WARP在线监测功能"
|
||||||
green "3. 刷warp+流量"
|
green "3. 刷warp+流量"
|
||||||
readp "请选择:" warptools
|
readp "请选择:" warptools
|
||||||
|
@ -1118,10 +1118,11 @@ fi
|
||||||
|
|
||||||
WARPonoff(){
|
WARPonoff(){
|
||||||
[[ ! $(type -P warp-go) ]] && red "WARP未安装,建议重新安装" && bash CFwarp.sh
|
[[ ! $(type -P warp-go) ]] && red "WARP未安装,建议重新安装" && bash CFwarp.sh
|
||||||
readp "1. 关闭WARP功能\n2. 开启/重启WARP功能\n0. 返回上一层\n 请选择:" unwp
|
readp "1. 关闭WARP功能(关闭WARP在线监测)\n2. 开启/重启WARP功能(启动WARP在线监测)\n0. 返回上一层\n 请选择:" unwp
|
||||||
if [ $unwp == "1" ]; then
|
if [ $unwp == "1" ]; then
|
||||||
kill -15 $(pgrep warp-go) >/dev/null 2>&1 && sleep 2
|
kill -15 $(pgrep warp-go) >/dev/null 2>&1 && sleep 2
|
||||||
systemctl disable warp-go
|
systemctl disable warp-go
|
||||||
|
screen -ls | awk '/\.up/ {print $1}' | cut -d "." -f 1 | xargs kill 2>/dev/null
|
||||||
checkwgcf
|
checkwgcf
|
||||||
[[ ! $wgcfv4 =~ on|plus && ! $wgcfv6 =~ on|plus ]] && green "关闭WARP成功" || red "关闭WARP失败"
|
[[ ! $wgcfv4 =~ on|plus && ! $wgcfv6 =~ on|plus ]] && green "关闭WARP成功" || red "关闭WARP失败"
|
||||||
ShowWGCF && WGCFmenu
|
ShowWGCF && WGCFmenu
|
||||||
|
@ -1130,6 +1131,9 @@ kill -15 $(pgrep warp-go) >/dev/null 2>&1 && sleep 2
|
||||||
systemctl restart warp-go
|
systemctl restart warp-go
|
||||||
systemctl enable warp-go
|
systemctl enable warp-go
|
||||||
systemctl start warp-go
|
systemctl start warp-go
|
||||||
|
xyz
|
||||||
|
name=`screen -ls | grep '(Detached)' | awk '{print $1}' | awk -F "." '{print $2}'`
|
||||||
|
[[ $name =~ "up" ]] && green "WARP在线监测启动成功" || red "WARP在线监测启动失败,查看screen是否安装成功"
|
||||||
checkwgcf
|
checkwgcf
|
||||||
[[ $wgcfv4 =~ on|plus || $wgcfv6 =~ on|plus ]] && green "开启WARP成功" || red "开启WARP失败"
|
[[ $wgcfv4 =~ on|plus || $wgcfv6 =~ on|plus ]] && green "开启WARP成功" || red "开启WARP失败"
|
||||||
ShowWGCF && WGCFmenu
|
ShowWGCF && WGCFmenu
|
||||||
|
@ -1650,16 +1654,20 @@ esac
|
||||||
|
|
||||||
WARPonoff(){
|
WARPonoff(){
|
||||||
[[ ! $(type -P wg-quick) ]] && red "WARP未安装,建议重新安装" && bash CFwarp.sh
|
[[ ! $(type -P wg-quick) ]] && red "WARP未安装,建议重新安装" && bash CFwarp.sh
|
||||||
readp "1. 关闭WARP功能\n2. 开启/重启WARP功能\n0. 返回上一层\n 请选择:" unwp
|
readp "1. 关闭WARP功能(关闭WARP在线监测)\n2. 开启/重启WARP功能(启动WARP在线监测)\n0. 返回上一层\n 请选择:" unwp
|
||||||
if [ $unwp == "1" ]; then
|
if [ $unwp == "1" ]; then
|
||||||
wg-quick down wgcf >/dev/null 2>&1
|
wg-quick down wgcf >/dev/null 2>&1
|
||||||
systemctl stop wg-quick@wgcf >/dev/null 2>&1
|
systemctl stop wg-quick@wgcf >/dev/null 2>&1
|
||||||
systemctl disable wg-quick@wgcf >/dev/null 2>&1
|
systemctl disable wg-quick@wgcf >/dev/null 2>&1
|
||||||
|
screen -ls | awk '/\.up/ {print $1}' | cut -d "." -f 1 | xargs kill 2>/dev/null
|
||||||
checkwgcf
|
checkwgcf
|
||||||
[[ ! $wgcfv4 =~ on|plus && ! $wgcfv6 =~ on|plus ]] && green "关闭warp成功" || red "关闭warp失败"
|
[[ ! $wgcfv4 =~ on|plus && ! $wgcfv6 =~ on|plus ]] && green "关闭warp成功" || red "关闭warp失败"
|
||||||
elif [ $unwp == "2" ]; then
|
elif [ $unwp == "2" ]; then
|
||||||
wg-quick down wgcf >/dev/null 2>&1
|
wg-quick down wgcf >/dev/null 2>&1
|
||||||
systemctl restart wg-quick@wgcf >/dev/null 2>&1
|
systemctl restart wg-quick@wgcf >/dev/null 2>&1
|
||||||
|
xyz
|
||||||
|
name=`screen -ls | grep '(Detached)' | awk '{print $1}' | awk -F "." '{print $2}'`
|
||||||
|
[[ $name =~ "up" ]] && green "WARP在线监测启动成功" || red "WARP在线监测启动失败,查看screen是否安装成功"
|
||||||
checkwgcf
|
checkwgcf
|
||||||
[[ $wgcfv4 =~ on|plus || $wgcfv6 =~ on|plus ]] && green "开启warp成功" || red "开启warp失败"
|
[[ $wgcfv4 =~ on|plus || $wgcfv6 =~ on|plus ]] && green "开启warp成功" || red "开启warp失败"
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue