Update unlock.sh

dependabot/github_actions/actions/checkout-3.1.0
fscarmen 4 years ago committed by GitHub
parent 803f4b7b85
commit 56472d592e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      unlock.sh

@ -467,17 +467,18 @@ statistics_of_run-times
select_laguage
# 传参 2/2
while getopts ":CcEeUu46SsM:m:A:a:N:n:T:t:" OPTNAME; do
while getopts ":CcEeUu46SsPpM:m:A:a:N:n:T:t:" OPTNAME; do
case "$OPTNAME" in
'C'|'c' ) L='C';;
'E'|'e' ) L='E';;
'U'|'u' ) if [ ! -e /etc/wireguard/warp_unlock.sh ]; then red " ${T[${L}27]} " && exit 1
else UN=1; uninstall; exit 0; fi;;
'4' ) TRACE4=$(curl -ks4m8 https://www.cloudflare.com/cdn-cgi/trace | grep warp | sed "s/warp=//g")
[[ ! $TRACE4 =~ on|plus ]] && red " ${T[${L}24]} " && exit 1 || STATUS=(1 0 0);;
[[ ! $TRACE4 =~ on|plus ]] && red " ${T[${L}24]} " && exit 1 || STATUS=(1 0 0 0);;
'6' ) TRACE6=$(curl -ks6m8 https://www.cloudflare.com/cdn-cgi/trace | grep warp | sed "s/warp=//g")
[[ ! $TRACE6 =~ on|plus ]] && red " ${T[${L}24]} " && exit 1 || STATUS=(0 1 0);;
'S'|'s' ) [[ ! $(ss -nltp) =~ 'warp-svc' ]] && red " ${T[${L}24]} " && exit 1 || STATUS=(0 0 1);;
[[ ! $TRACE6 =~ on|plus ]] && red " ${T[${L}24]} " && exit 1 || STATUS=(0 1 0 0);;
'S'|'s' ) [[ ! $(ss -nltp) =~ 'warp-svc' ]] && red " ${T[${L}24]} " && exit 1 || STATUS=(0 0 1 0);;
'P'|'p' ) [[ ! $(ss -nltp) =~ 'wireproxy' ]] && red " ${T[${L}24]} " && exit 1 || STATUS=(0 0 0 1);;
'M'|'m' ) [ -z "$UNLOCK_MODE_NOW" ] && check_unlock_running
if [ -n "$UNLOCK_MODE_NOW" ]; then
red " ${T[${L}28]} " && exit 1

Loading…
Cancel
Save