|
|
@ -10,7 +10,7 @@ none='\e[0m' |
|
|
|
# Root |
|
|
|
# Root |
|
|
|
[[ $(id -u) != 0 ]] && echo -e " 哎呀……请使用 ${red}root ${none}用户运行 ${yellow}~(^_^) ${none}" && exit 1 |
|
|
|
[[ $(id -u) != 0 ]] && echo -e " 哎呀……请使用 ${red}root ${none}用户运行 ${yellow}~(^_^) ${none}" && exit 1 |
|
|
|
|
|
|
|
|
|
|
|
_version="old-v0.1" |
|
|
|
_version="old-v0.11" |
|
|
|
v2ray_latest_ver=v4.45.2 |
|
|
|
v2ray_latest_ver=v4.45.2 |
|
|
|
|
|
|
|
|
|
|
|
cmd="apt-get" |
|
|
|
cmd="apt-get" |
|
|
@ -1765,18 +1765,18 @@ change_proxy_site_config() { |
|
|
|
} |
|
|
|
} |
|
|
|
domain_check() { |
|
|
|
domain_check() { |
|
|
|
# test_domain=$(dig $new_domain +short) |
|
|
|
# test_domain=$(dig $new_domain +short) |
|
|
|
test_domain=$(ping $new_domain -c 1 -4 -W 2 | grep -oE -m1 "([0-9]{1,3}\.){3}[0-9]{1,3}") |
|
|
|
test_domain=$(ping $new_domain -c 1 -W 2 | head -1) |
|
|
|
# test_domain=$(wget -qO- --header='accept: application/dns-json' "https://cloudflare-dns.com/dns-query?name=$new_domain&type=A" | grep -oE "([0-9]{1,3}\.){3}[0-9]{1,3}" | head -1) |
|
|
|
# test_domain=$(wget -qO- --header='accept: application/dns-json' "https://cloudflare-dns.com/dns-query?name=$new_domain&type=A" | grep -oE "([0-9]{1,3}\.){3}[0-9]{1,3}" | head -1) |
|
|
|
# test_domain=$(curl -sH 'accept: application/dns-json' "https://cloudflare-dns.com/dns-query?name=$new_domain&type=A" | grep -oE "([0-9]{1,3}\.){3}[0-9]{1,3}" | head -1) |
|
|
|
# test_domain=$(curl -sH 'accept: application/dns-json' "https://cloudflare-dns.com/dns-query?name=$new_domain&type=A" | grep -oE "([0-9]{1,3}\.){3}[0-9]{1,3}" | head -1) |
|
|
|
if [[ $test_domain != $ip ]]; then |
|
|
|
if [[ ! $(echo $test_domain | grep $ip) ]]; then |
|
|
|
echo |
|
|
|
echo |
|
|
|
echo -e "$red 检测域名解析错误....$none" |
|
|
|
echo -e "$red 检测域名解析错误....$none" |
|
|
|
echo |
|
|
|
echo |
|
|
|
echo -e " 你的域名: $yellow$new_domain$none 未解析到: $cyan$ip$none" |
|
|
|
echo -e " 你的域名: $yellow$new_domain$none 未解析到: $cyan$ip$none" |
|
|
|
echo |
|
|
|
echo |
|
|
|
echo -e " 你的域名当前解析到: $cyan$test_domain$none" |
|
|
|
echo -e " PING 测试结果: $cyan$test_domain$none" |
|
|
|
echo |
|
|
|
echo |
|
|
|
echo "备注...如果你的域名是使用 Cloudflare 解析的话..在 Status 那里点一下那图标..让它变灰" |
|
|
|
echo "备注...如果你的域名是使用 Cloudflare 解析的话..在 DNS 那, 将 (Proxy status / 代理状态), 设置成 (DNS only / 仅限 DNS)" |
|
|
|
echo |
|
|
|
echo |
|
|
|
exit 1 |
|
|
|
exit 1 |
|
|
|
fi |
|
|
|
fi |
|
|
@ -2540,15 +2540,16 @@ backup_config() { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
get_ip() { |
|
|
|
get_ip() { |
|
|
|
ip=$(curl -s https://ipinfo.io/ip) |
|
|
|
# ip=$(curl -s https://ipinfo.io/ip) |
|
|
|
[[ -z $ip ]] && ip=$(curl -s https://api.ip.sb/ip) |
|
|
|
# [[ -z $ip ]] && ip=$(curl -s https://api.ip.sb/ip) |
|
|
|
[[ -z $ip ]] && ip=$(curl -s https://api.ipify.org) |
|
|
|
# [[ -z $ip ]] && ip=$(curl -s https://api.ipify.org) |
|
|
|
[[ -z $ip ]] && ip=$(curl -s https://ip.seeip.org) |
|
|
|
# [[ -z $ip ]] && ip=$(curl -s https://ip.seeip.org) |
|
|
|
[[ -z $ip ]] && ip=$(curl -s https://ifconfig.co/ip) |
|
|
|
# [[ -z $ip ]] && ip=$(curl -s https://ifconfig.co/ip) |
|
|
|
[[ -z $ip ]] && ip=$(curl -s https://api.myip.com | grep -oE "([0-9]{1,3}\.){3}[0-9]{1,3}") |
|
|
|
# [[ -z $ip ]] && ip=$(curl -s https://api.myip.com | grep -oE "([0-9]{1,3}\.){3}[0-9]{1,3}") |
|
|
|
[[ -z $ip ]] && ip=$(curl -s icanhazip.com) |
|
|
|
# [[ -z $ip ]] && ip=$(curl -s icanhazip.com) |
|
|
|
[[ -z $ip ]] && ip=$(curl -s myip.ipip.net | grep -oE "([0-9]{1,3}\.){3}[0-9]{1,3}") |
|
|
|
# [[ -z $ip ]] && ip=$(curl -s myip.ipip.net | grep -oE "([0-9]{1,3}\.){3}[0-9]{1,3}") |
|
|
|
[[ -z $ip ]] && echo -e "\n$red 这垃圾小鸡扔了吧!$none\n" && exit |
|
|
|
export "$(wget -qO- https://dash.cloudflare.com/cdn-cgi/trace | grep ip=)" >/dev/null 2>&1 |
|
|
|
|
|
|
|
[[ -z $ip ]] && echo -e "\n$red 获取IP失败, 这垃圾小鸡扔了吧!$none\n" && exit |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
error() { |
|
|
|
error() { |
|
|
|