Add IPv6 support if IPv6 is exist
This commit is contained in:
parent
e3c1c63fd6
commit
895143b1f9
|
|
@ -35,6 +35,15 @@ get_ip(){
|
||||||
[ ! -z ${IP} ] && echo ${IP} || echo
|
[ ! -z ${IP} ] && echo ${IP} || echo
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get_ipv6(){
|
||||||
|
local ipv6=$(wget -qO- -t1 -T2 ipv6.icanhazip.com)
|
||||||
|
if [ -z ${ipv6} ]; then
|
||||||
|
return 1
|
||||||
|
else
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
get_latest_version(){
|
get_latest_version(){
|
||||||
ver=$(wget -qO- https://api.github.com/repos/shadowsocks/shadowsocks-libev/releases/latest | grep 'tag_name' | cut -d\" -f4)
|
ver=$(wget -qO- https://api.github.com/repos/shadowsocks/shadowsocks-libev/releases/latest | grep 'tag_name' | cut -d\" -f4)
|
||||||
[ -z ${ver} ] && echo "Error: Get shadowsocks-libev latest version failed" && exit 1
|
[ -z ${ver} ] && echo "Error: Get shadowsocks-libev latest version failed" && exit 1
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user