Loading script/_ssh-config.sh +10 −1 Original line number Diff line number Diff line Loading @@ -6,7 +6,8 @@ then exit 1 fi remoteHost=$(echo "${SSH_REMOTE}" | cut -f 2 -d '@') remoteUser=$(echo "${SSH_REMOTE}" | cut -d '@' -f 1) remoteHost=$(echo "${SSH_REMOTE}" | cut -d '@' -f 2) if [ -z "${remoteHost}" ] then Loading @@ -25,3 +26,11 @@ eval "$(ssh-agent)" > /dev/null echo "${DEPLOY_KEY}" | tr -d '\r' | ssh-add - > /dev/null 2>&1 closeSshCmd="ssh ${SSH_PARAMS} -q -O exit \"${SSH_REMOTE}\"" # Se comprueba si está disponible la conexión hacia el entorno donde se va a desplegar. if ! ssh ${SSH_PARAMS} "${SSH_REMOTE}" : &> /dev/null then echo -e "\n${FAIL_COLOR}Failed to connect to host ${DATA_COLOR}${remoteHost}${INFO_COLOR} at port ${DATA_COLOR}${SSH_PORT}${INFO_COLOR} with user ${DATA_COLOR}${remoteUser}${INFO_COLOR}!${NULL_COLOR}" eval "${closeSshCmd}" exit 1 fi Loading
script/_ssh-config.sh +10 −1 Original line number Diff line number Diff line Loading @@ -6,7 +6,8 @@ then exit 1 fi remoteHost=$(echo "${SSH_REMOTE}" | cut -f 2 -d '@') remoteUser=$(echo "${SSH_REMOTE}" | cut -d '@' -f 1) remoteHost=$(echo "${SSH_REMOTE}" | cut -d '@' -f 2) if [ -z "${remoteHost}" ] then Loading @@ -25,3 +26,11 @@ eval "$(ssh-agent)" > /dev/null echo "${DEPLOY_KEY}" | tr -d '\r' | ssh-add - > /dev/null 2>&1 closeSshCmd="ssh ${SSH_PARAMS} -q -O exit \"${SSH_REMOTE}\"" # Se comprueba si está disponible la conexión hacia el entorno donde se va a desplegar. if ! ssh ${SSH_PARAMS} "${SSH_REMOTE}" : &> /dev/null then echo -e "\n${FAIL_COLOR}Failed to connect to host ${DATA_COLOR}${remoteHost}${INFO_COLOR} at port ${DATA_COLOR}${SSH_PORT}${INFO_COLOR} with user ${DATA_COLOR}${remoteUser}${INFO_COLOR}!${NULL_COLOR}" eval "${closeSshCmd}" exit 1 fi