Open jiaoluoshi opened 3 weeks ago
看日志,访问不了 cf 的官网,你先试试手动
curl --retry 2 -ksm5 https://www.cloudflare.com/cdn-cgi/trace
正常应该如下的
root@gcp:~# curl --retry 2 -ksm5 https://www.cloudflare.com/cdn-cgi/trace
fl=14f686
h=www.cloudflare.com
ip=34.66.96.126
ts=1730941858.372
visit_scheme=https
uag=curl/7.88.1
colo=ORD
sliver=none
http=http/2
loc=US
tls=TLSv1.3
sni=plaintext
warp=off
gateway=off
rbi=off
kex=X25519
root@localhost:~# wget -N https://gitlab.com/fscarmen/warp/-/raw/main/menu.sh && bash -x menu.sh [option] [lisence/url/token] --2024-10-31 16:40:13-- https://gitlab.com/fscarmen/warp/-/raw/main/menu.sh Resolving gitlab.com (gitlab.com)... 172.65.251.78, 2606:4700:90:0:f22e:fbec:5bed:a9b9 Connecting to gitlab.com (gitlab.com)|172.65.251.78|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 169529 (166K) [text/plain] Saving to: ‘menu.sh’
menu.sh 100%[=======================================================>] 165.56K --.-KB/s in 0.04s
Last-modified header missing -- time-stamps turned off. 2024-10-31 16:40:18 (4.10 MB/s) - ‘menu.sh’ saved [169529/169529]
echo -e '\033[33m\033[01m \n Language:\n 1. English (default) \n 2. 简体中文 \n\033[0m'
Language:
++ text 50 ++ grep -q '\$' ++ eval echo '${E[50]}' +++ echo Choose:
reading ' Choose: ' LANGUAGE ++ info ' Choose: ' ++ echo -e '\033[32m\033[01m Choose: \033[0m'
read -rp ' Choose: ' LANGUAGE Choose: 2
'[' 2 = 2 ']'
L=C
check_operating_system
'[' -s /etc/os-release ']' ++ cut -d '"' -f2 ++ grep -i pretty_name /etc/os-release
SYS='Debian GNU/Linux 12 (bookworm)'
REGEX=("debian" "ubuntu" "centos|red hat|kernel|alma|rocky" "alpine" "arch linux" "fedora")
RELEASE=("Debian" "Ubuntu" "CentOS" "Alpine" "Arch" "Fedora")
EXCLUDE=("---")
MAJOR=("9" "16" "7" "" "" "37")
PACKAGE_UPDATE=("apt -y update" "apt -y update" "yum -y update --skip-broken" "apk update -f" "pacman -Sy" "dnf -y update")
PACKAGE_INSTALL=("apt -y install" "apt -y install" "yum -y install" "apk add -f" "pacman -S --noconfirm" "dnf -y install")
PACKAGE_UNINSTALL=("apt -y autoremove" "apt -y autoremove" "yum -y autoremove" "apk del -f" "pacman -Rcnsu --noconfirm" "dnf -y autoremove")
SYSTEMCTL_START=("systemctl start wg-quick@warp" "systemctl start wg-quick@warp" "systemctl start wg-quick@warp" "wg-quick up warp" "systemctl start wg-quick@warp" "systemctl start wg-quick@warp")
SYSTEMCTL_RESTART=("systemctl restart wg-quick@warp" "systemctl restart wg-quick@warp" "systemctl restart wg-quick@warp" "alpine_warp_restart" "systemctl restart wg-quick@warp" "systemctl restart wg-quick@warp")
SYSTEMCTL_ENABLE=("systemctl enable --now wg-quick@warp" "systemctl enable --now wg-quick@warp" "systemctl enable --now wg-quick@warp" "alpine_warp_enable" "systemctl enable --now wg-quick@warp" "systemctl enable --now wg-quick@warp")
for int in "${!REGEX[@]}"
[[ debian gnu/linux 12 (bookworm) =~ debian ]]
SYSTEM=Debian
break
'[' -z Debian ']' ++ cut -d. -f1 ++ sed 's/[^0-9.]//g'
MAJOR_VERSION=12
for ex in "${EXCLUDE[@]}"
[[ ! debian gnu/linux 12 (bookworm) =~ --- ]]
[[ 12 -lt 9 ]]
case "$OPTION" in
check_root ++ id -u
'[' 0 '!=' 0 ']'
case "$OPTION" in
check_dependencies
'[' Debian = Alpine ']'
DEPS_CHECK=("ping" "wget" "curl" "systemctl" "ip")
DEPS_INSTALL=("iputils-ping" "wget" "curl" "systemctl" "iproute2")
for g in "${!DEPS_CHECK[@]}" ++ type -p ping
'[' '!' -x /usr/bin/ping ']'
for g in "${!DEPS_CHECK[@]}" ++ type -p wget
'[' '!' -x /usr/bin/wget ']'
for g in "${!DEPS_CHECK[@]}" ++ type -p curl
'[' '!' -x /usr/bin/curl ']'
for g in "${!DEPS_CHECK[@]}" ++ type -p systemctl
'[' '!' -x /usr/bin/systemctl ']'
for g in "${!DEPS_CHECK[@]}" ++ type -p ip
'[' '!' -x /usr/sbin/ip ']'
'[' 0 -ge 1 ']' ++ text 8 ++ grep -q '\$' ++ eval echo '${C[8]}' +++ echo 所有依赖已存在,不需要额外安装
info '\n 所有依赖已存在,不需要额外安装 \n'
echo -e '\033[32m\033[01m\n 所有依赖已存在,不需要额外安装 \n\033[0m'
所有依赖已存在,不需要额外安装
PING6='ping -6' ++ type -p ping6
'[' -x /usr/bin/ping6 ']'
PING6=ping6
check_virt Debian
'[' Debian = Alpine ']' ++ type -p systemd-detect-virt
'[' /usr/bin/systemd-detect-virt ']' ++ systemd-detect-virt
VIRT=kvm
[[ -z kvm ]]
check_system_info ++ text 37 ++ grep -q '\$' ++ eval echo '${C[37]}' +++ echo 检查环境中……
info ' 检查环境中…… '
echo -e '\033[32m\033[01m 检查环境中…… \033[0m' 检查环境中……
'[' '!' -e /sys/module/wireguard ']'
KERNEL_ENABLE=1 ++ cat /dev/net/tun
TUN='cat: /dev/net/tun: File descriptor in bad state'
[[ cat: /dev/net/tun: File descriptor in bad state =~ in bad state|处于错误状态 ]]
WIREGUARD_GO_ENABLE=1
IPV4=0
IPV6=0 ++ awk '{for (i=0; i<NF; i++) if ($i=="src") {print $(i+1)}}' ++ ip route get 192.168.193.10
LAN4=38.54.86.152 ++ awk '{for (i=0; i<NF; i++) if ($i=="src") {print $(i+1)}}' ++ ip route get 2606:4700:d0::a29f:c001
LAN6= ++ awk '-F: ' '{print $2}' ++ ip link show
[[ lo
eth0
eth1 =~ warp ]]
[[ '' != \:\:\1 ]]
[[ '' =~ ^[a-f0-9:]+$ ]]
[[ 38.54.86.152 =~ ^([0-9]{1,3}.){3} ]]
INET4=1
ping -c2 -W3 162.159.193.10
IPV4=1
STACK=-4
ip_case 4 warp
local CHECK_46=4
'[' -n warp ']'
local CHECK_TYPE=warp
'[' '' = non-global ']'
'[' warp = warp ']'
case "$CHECK_46" in
fetch_4
unset IP_RESULT4 COUNTRY4 ASNORG4 TRACE4 IS_UNINSTALL
local IS_UNINSTALL= ++ ip_info 4 '' '' ++ local CHECK_46=4 ++ [[ '' =~ ^[0-9]+$ ]] ++ [[ '' =~ ^[[:alnum:]]+$ ]] ++ local IS_UNINSTALL= ++ '[' C = C ']' ++ IS_CHINESE='?lang=zh-CN' ++ '[' 4 = 6 ']' ++ CHOOSE_IP_API=https://api-ipv4.ip.sb/geoip +++ awk -F = '/^warp=/{print $NF}' +++ curl --retry 2 -ksm5 https://www.cloudflare.com/cdn-cgi/trace ++ IP_TRACE= ++ '[' -n '' ']' ++ echo -e 'trace=@\nip=@\ncountry=@\nasnorg=\n'
local 'IP_RESULT4=trace=@ ip=@ country=@ asnorg=' ++ expr 'trace=@ ip=@ country=@ asnorg=' : '.trace=([^@]).*'
TRACE4= ++ expr 'trace=@ ip=@ country=@ asnorg=' : '.ip=([^@]).*'
WAN4= ++ expr 'trace=@ ip=@ country=@ asnorg=' : '.country=([^@]).*'
COUNTRY4= ++ expr 'trace=@ ip=@ country=@ asnorg=' : '.asnorg=([^@]).*'
ASNORG4=
[[ '' =~ on|plus ]]
PLAN=1
case $(uname -m) in ++ uname -m
ARCHITECTURE=amd64
CLIENT=0 ++ type -p warp-cli
'[' -x '' ']'
WIREPROXY=0 ++ type -p wireproxy
'[' -x '' ']'
[[ 0 = 0 ]]
[[ 0 = 0 ]]
[[ ! -s /etc/wireguard/warp.conf ]]
menu_setting
[[ 0 -gt 1 ]]
[[ 0 -gt 0 ]]
check_stack
'[' -e /etc/wireguard/warp.conf ']'
case "$TRACE4" in
case "$TRACE6" in
CASE=("@0" "0@" "0@0" "@1" "0@1" "1@" "1@0" "1@1" "@")
for m in ${!CASE[@]}
'[' @ = @0 ']'
for m in ${!CASE[@]}
'[' @ = 0@ ']'
for m in ${!CASE[@]}
'[' @ = 0@0 ']'
for m in ${!CASE[@]}
'[' @ = @1 ']'
for m in ${!CASE[@]}
'[' @ = 0@1 ']'
for m in ${!CASE[@]}
'[' @ = 1@ ']'
for m in ${!CASE[@]}
'[' @ = 1@0 ']'
for m in ${!CASE[@]}
'[' @ = 1@1 ']'
for m in ${!CASE[@]}
'[' @ = @ ']'
break
WARP_BEFORE=("" "" "" "WARP IPv6 only" "WARP IPv6" "WARP IPv4 only" "WARP IPv4" "$(text 70)")
best_endpoint
wget -4 -qO /tmp/endpoint https://gitlab.com/fscarmen/warp/-/raw/main/endpoint/warp-linux-amd64 ++ text 70
best_mtu
MTU=1472
'[' 10 = 01 ']'
ping -c1 -W1 -s 1472 -Mdo 162.159.193.10 ++ grep -q '\$' ++ eval echo '${C[70]}' +++ echo WARP 双栈
WARP_AFTER1=("" "" "" "WARP IPv4" "WARP IPv4" "WARP IPv6" "WARP IPv6" "WARP IPv4")
WARP_AFTER2=("" "" "" "$(text 70)" "$(text 70)" "$(text 70)" "$(text 70)" "WARP IPv6")
[[ 0 = 0 ]]
'[' 1472 -eq 1472 ']'
MTU=1472
MTU=1420
echo 1420 ++ text 70 ++ grep -q '\$' ++ eval echo '${C[70]}' +++ echo WARP 双栈 ++ text 70 ++ grep -q '\$' ++ eval echo '${C[70]}' +++ echo WARP 双栈 ++ text 70 ++ grep -q '\$' ++ eval echo '${C[70]}' +++ echo WARP 双栈 ++ text 70 ++ grep -q '\$' ++ eval echo '${C[70]}' +++ echo WARP 双栈
TO1=("" "" "" "014" "014" "106" "106" "114")
TO2=("" "" "" "01D" "01D" "10D" "10D" "116")
SHORTCUT1=("" "" "" "(warp 4)" "(warp 4)" "(warp 6)" "(warp 6)" "(warp 4)")
SHORTCUT2=("" "" "" "(warp d)" "(warp d)" "(warp d)" "(warp d)" "(warp 6)")
'[' 8 -le 3 ']'
'[' 8 = 8 ']' ++ text 189 ++ grep -q '\$' ++ eval echo '${C[189]}' +++ echo 检测不到任何 IPv4 或 'IPv6。脚本中止,问题反馈:[https://github.com/fscarmen/warp-sh/issues]'
error '\n 检测不到任何 IPv4 或 IPv6。脚本中止,问题反馈:[https://github.com/fscarmen/warp-sh/issues] \n'
echo -e '\033[31m\033[01m\n 检测不到任何 IPv4 或 IPv6。脚本中止,问题反馈:[https://github.com/fscarmen/warp-sh/issues] \n\033[0m'
检测不到任何 IPv4 或 IPv6。脚本中止,问题反馈:[https://github.com/fscarmen/warp-sh/issues]
exit 1 root@localhost:~# + chmod +x /tmp/endpoint
'[' 10 = 01 ']'
wget -4 -qO /tmp/ip https://gitlab.com/fscarmen/warp/-/raw/main/endpoint/ipv4
[[ -e /tmp/endpoint ]]
[[ -e /tmp/ip ]]
/tmp/endpoint -file /tmp/ip -output /tmp/endpoint_result ++ awk -F, 'NR==1 {print $2}' ++ grep -sE '[0-9]+[ ]+ms$' /tmp/endpoint_result
'[' 0.00% = 100.00% ']' ++ awk -F, 'NR==1 {print $1}' ++ grep -sE '[0-9]+[ ]+ms$' /tmp/endpoint_result
ENDPOINT=162.159.195.4:890
rm -f /tmp/endpoint /tmp/ip /tmp/endpoint_result
'[' 10 = 01 ']'
ENDPOINT=162.159.195.4:890
'[' '!' -e /tmp/noudp ']'
echo 162.159.195.4:890