From cee9bb6fb0bec1ae3250cf9b21cc61e559bbcdce Mon Sep 17 00:00:00 2001 From: 233boy Date: Sat, 8 Dec 2018 13:32:01 +0800 Subject: [PATCH] fix ip addr issue --- install.sh | 8 ++++++++ v2ray.sh | 15 +++++++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index c12e6cf..670bc70 100644 --- a/install.sh +++ b/install.sh @@ -1436,6 +1436,14 @@ try_enable_bbr() { get_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.ipify.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://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 myip.ipip.net | grep -oE "([0-9]{1,3}\.){3}[0-9]{1,3}") + [[ -z $ip ]] && echo -e "\n$red 这垃圾小鸡扔了吧!$none\n" && exit } error() { diff --git a/v2ray.sh b/v2ray.sh index 5817478..c6d72f8 100644 --- a/v2ray.sh +++ b/v2ray.sh @@ -10,7 +10,7 @@ none='\e[0m' # Root [[ $(id -u) != 0 ]] && echo -e " 哎呀……请使用 ${red}root ${none}用户运行 ${yellow}~(^_^) ${none}" && exit 1 -_version="v2.46" +_version="v2.47" cmd="apt-get" @@ -47,7 +47,6 @@ backup="/etc/v2ray/233blog_v2ray_backup.conf" if [[ -f /usr/bin/v2ray/v2ray && -f /etc/v2ray/config.json ]] && [[ -f $backup && -d /etc/v2ray/233boy/v2ray ]]; then . $backup - v2ray_ver="v$(/usr/bin/v2ray/v2ray -version | head -n 1 | cut -d " " -f2)" if [[ ! $username ]]; then . /etc/v2ray/233boy/v2ray/tools/support_socks.sh fi @@ -84,7 +83,11 @@ v2ray_client_config="/etc/v2ray/233blog_v2ray_config.json" v2ray_pid=$(ps ux | grep "/usr/bin/v2ray/v2ray" | grep -v grep | awk '{print $2}') caddy_pid=$(pgrep "caddy") _v2ray_sh="/usr/local/sbin/v2ray" +v2ray_ver="$(/usr/bin/v2ray/v2ray -version | head -n 1 | cut -d " " -f2)" +if [[ $v2ray_ver != v* ]]; then + v2ray_ver="v$v2ray_ver" +fi if [[ ! -f $_v2ray_sh ]]; then mv -f /usr/local/bin/v2ray $_v2ray_sh chmod +x $_v2ray_sh @@ -3592,6 +3595,14 @@ _boom_() { get_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.ipify.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://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 myip.ipip.net | grep -oE "([0-9]{1,3}\.){3}[0-9]{1,3}") + [[ -z $ip ]] && echo -e "\n$red 这垃圾小鸡扔了吧!$none\n" && exit } error() {