From 916bc7fe62eb99c345b9e90693553f8b639b5741 Mon Sep 17 00:00:00 2001 From: boypt Date: Tue, 26 Feb 2019 17:24:55 +0800 Subject: [PATCH] only debian/ub need update before install --- install.sh | 24 +++++++++++++++--------- src/ss-info.sh | 9 +++++++++ src/v2ray-info.sh | 1 + 3 files changed, 25 insertions(+), 9 deletions(-) diff --git a/install.sh b/install.sh index 9811dbd..c230243 100644 --- a/install.sh +++ b/install.sh @@ -729,8 +729,8 @@ install_v2ray() { echo -e "$yellow 同步系统仓库并安装必须组件,请骚吼~~~~~~~~~ $none" echo echo - $cmd update -y if [[ $cmd == "apt-get" ]]; then + $cmd update -y $cmd install -y socat lrzsz git zip unzip curl wget qrencode libcap2-bin else # $cmd install -y lrzsz git zip unzip curl wget qrencode libcap iptables-services @@ -835,15 +835,21 @@ backup_config() { } 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}") + ip=$(curl -4 -s https://ipinfo.io/ip) + [[ -z $ip ]] && ip=$(curl -4 -s https://api.ip.sb/ip) + [[ -z $ip ]] && ip=$(curl -4 -s https://api.ipify.org) + [[ -z $ip ]] && ip=$(curl -4 -s https://ip.seeip.org) + [[ -z $ip ]] && ip=$(curl -4 -s https://ifconfig.co/ip) + [[ -z $ip ]] && ip=$(curl -4 -s https://api.myip.com | grep -oE "([0-9]{1,3}\.){3}[0-9]{1,3}") + [[ -z $ip ]] && ip=$(curl -4 -s icanhazip.com) + [[ -z $ip ]] && ip=$(curl -4 -s myip.ipip.net | grep -oE "([0-9]{1,3}\.){3}[0-9]{1,3}") [[ -z $ip ]] && echo -e "\n$red 这垃圾小鸡扔了吧!$none\n" && exit + + v6ip=$(curl -6 -s https://ifconfig.co/ip) + [[ -z $v6ip ]] && v6ip=$(curl -6 -s https://api.ip.sb/ip) + [[ -z $v6ip ]] && v6ip=$(curl -6 -s https://ip.seeip.org) + [[ -z $v6ip ]] && v6ip=$(curl -6 -s http://icanhazip.com) + [[ -z $v6ip ]] && v6ip=$(curl -6 -s https://api.myip.com | cut -d\" -f4) } error() { diff --git a/src/ss-info.sh b/src/ss-info.sh index 6f8b469..b5bd971 100644 --- a/src/ss-info.sh +++ b/src/ss-info.sh @@ -13,6 +13,11 @@ if [[ $shadowsocks ]]; then echo echo -e "$yellow 服务器地址 = $cyan${ip}$none" echo + if [[ $v6ip ]]; then + local ssv6="ss://${cipherstr}@[${v6ip}]:${ssport}#v2ray6.com_ss_${ip}" + echo -e "$yellow 服务器IPv6地址 = $cyan${v6ip}$none" + echo + fi echo -e "$yellow 服务器端口 = $cyan$ssport$none" echo echo -e "$yellow 密码 = $cyan$sspass$none" @@ -21,6 +26,10 @@ if [[ $shadowsocks ]]; then echo echo -e "$yellow SS 链接 = ${cyan}$ss$none" echo + if [[ $ssv6 ]]; then + echo -e "$yellow SS IPv6 链接 = ${cyan}$ssv6$none" + echo + fi if [[ $ssray ]]; then echo -e "$yellow SS + V2ray - Plugin 地址 = ${cyan}${ssray_domain}$none" echo diff --git a/src/v2ray-info.sh b/src/v2ray-info.sh index 9162419..79f5cc8 100644 --- a/src/v2ray-info.sh +++ b/src/v2ray-info.sh @@ -71,6 +71,7 @@ _v2_args() { } _v2_info() { + [[ -z $ip ]] && get_ip echo echo echo "---------- V2Ray 配置信息 -------------"