fix ipv6 support

This commit is contained in:
xiongdian.me 2023-06-02 11:09:50 +08:00
parent 817658efab
commit 76a941ac75

View File

@ -22,7 +22,7 @@ get_server_meta() {
remote=${remote#*@} remote=${remote#*@}
fi fi
# if in the form ...:22 # if in the form ...:22
if [[ "$remote" == *:* ]]; then if [[ "$remote" == "["*"]":* || ( "$remote" != "["*"]" && "$remote" == *:* ) ]]; then
RET_PORT=${remote##*:} RET_PORT=${remote##*:}
remote=${remote%:*} remote=${remote%:*}
fi fi
@ -30,7 +30,7 @@ get_server_meta() {
local domain=${remote##*.} local domain=${remote##*.}
local host=${remote%.*} local host=${remote%.*}
# if there's no dot # if there's no dot
if [[ "$host" == "$domain" ]]; then if [[ "$host" == "$domain" && "$host" != "["*"]" ]]; then
domain="ibd" domain="ibd"
fi fi
case $domain in case $domain in