mirror of
https://github.com/DictXiong/dotfiles.git
synced 2024-11-24 07:27:03 +08:00
fix ipv6 support
This commit is contained in:
parent
817658efab
commit
76a941ac75
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue
Block a user