fix ip addr issue

pull/86/head^2
233boy 6 years ago
parent 0b7542db23
commit cee9bb6fb0
  1. 8
      install.sh
  2. 15
      v2ray.sh

@ -1436,6 +1436,14 @@ try_enable_bbr() {
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.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() { error() {

@ -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="v2.46" _version="v2.47"
cmd="apt-get" 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 if [[ -f /usr/bin/v2ray/v2ray && -f /etc/v2ray/config.json ]] && [[ -f $backup && -d /etc/v2ray/233boy/v2ray ]]; then
. $backup . $backup
v2ray_ver="v$(/usr/bin/v2ray/v2ray -version | head -n 1 | cut -d " " -f2)"
if [[ ! $username ]]; then if [[ ! $username ]]; then
. /etc/v2ray/233boy/v2ray/tools/support_socks.sh . /etc/v2ray/233boy/v2ray/tools/support_socks.sh
fi 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}') v2ray_pid=$(ps ux | grep "/usr/bin/v2ray/v2ray" | grep -v grep | awk '{print $2}')
caddy_pid=$(pgrep "caddy") caddy_pid=$(pgrep "caddy")
_v2ray_sh="/usr/local/sbin/v2ray" _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 if [[ ! -f $_v2ray_sh ]]; then
mv -f /usr/local/bin/v2ray $_v2ray_sh mv -f /usr/local/bin/v2ray $_v2ray_sh
chmod +x $_v2ray_sh chmod +x $_v2ray_sh
@ -3592,6 +3595,14 @@ _boom_() {
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.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() { error() {

Loading…
Cancel
Save