fix ip addr issue
This commit is contained in:
15
v2ray.sh
15
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() {
|
||||
|
Reference in New Issue
Block a user