From d95a7435b565a2fedb9bf4100cdeb3342aa3cf16 Mon Sep 17 00:00:00 2001 From: Jim Cronqvist Date: Fri, 24 Mar 2023 11:12:06 +0100 Subject: [PATCH] Fix missing support for a custom ssh port --- entrypoint.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index b9baf43..fef744a 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -33,9 +33,9 @@ echo "" for host in ${INPUT_HOSTS}; do echo -e "${BLUE}Connecting to ${host}...${NORMAL}" PORT=$(echo "$host" | cut -s -d':' -f2 | sed 's/[^0-9]//g') - sh -c "ssh -q -t -i ~/.ssh/id_rsa -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no '${host}' -p ${PORT:-22} < ~/script.sh" + sh -c "ssh -q -t -i ~/.ssh/id_rsa -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no '${host%%:*}' -p ${PORT:-22} < ~/script.sh" echo "" done echo "" -echo -e "${BLUE}GitHub Action completed.${NORMAL}" \ No newline at end of file +echo -e "${BLUE}GitHub Action completed.${NORMAL}"