Support full links in Docker wait script

Remove http(s) and trailing slash.

Change-Id: Ia7a471e73ebd23a2005a78d71419b52a9720b6bb
This commit is contained in:
Dobroslaw Zybort 2019-03-12 13:52:38 +01:00
parent 5cfcbda66c
commit 4c077af2f6
1 changed files with 4 additions and 2 deletions

View File

@ -42,7 +42,9 @@ wait_for() {
for var in "$@"
do
host=${var%:*}
port=${var#*:}
# nc does not work with links containing http(s), remove trailing slash
clean_link=$(echo "$var" | sed -e "s/^http[s]*:\/\///" | sed 's:/*$::')
host=${clean_link%:*}
port=${clean_link#*:}
wait_for "$host" "$port"
done