From 76a941ac75c928e86b9ea2d2491d7d5312464d56 Mon Sep 17 00:00:00 2001 From: "xiongdian.me" Date: Fri, 2 Jun 2023 11:09:50 +0800 Subject: [PATCH] fix ipv6 support --- scripts/riot | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/riot b/scripts/riot index 4bbdd54..65e8d32 100755 --- a/scripts/riot +++ b/scripts/riot @@ -22,7 +22,7 @@ get_server_meta() { remote=${remote#*@} fi # if in the form ...:22 - if [[ "$remote" == *:* ]]; then + if [[ "$remote" == "["*"]":* || ( "$remote" != "["*"]" && "$remote" == *:* ) ]]; then RET_PORT=${remote##*:} remote=${remote%:*} fi @@ -30,7 +30,7 @@ get_server_meta() { local domain=${remote##*.} local host=${remote%.*} # if there's no dot - if [[ "$host" == "$domain" ]]; then + if [[ "$host" == "$domain" && "$host" != "["*"]" ]]; then domain="ibd" fi case $domain in