shellcheck fix
This commit is contained in:
@@ -2,26 +2,32 @@
|
|||||||
|
|
||||||
ERROR=0
|
ERROR=0
|
||||||
|
|
||||||
|
# shellcheck disable=2154 # 2154 irrelevant because the ENV variable should come from container invokation
|
||||||
if [ "${SSH_USER}" = "" ] ; then
|
if [ "${SSH_USER}" = "" ] ; then
|
||||||
echo You must set the SSH_USER environment variable
|
echo You must set the SSH_USER environment variable
|
||||||
ERROR=1
|
ERROR=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# shellcheck disable=2154 # 2154 irrelevant because the ENV variable should come from container invokation
|
||||||
|
# shellcheck disable=2153 # 2153 irrelevant because SSH_HOST is the correct ENV variable
|
||||||
if [ "${SSH_HOST}" = "" ] ; then
|
if [ "${SSH_HOST}" = "" ] ; then
|
||||||
echo You must set the SSH_HOST environment variable
|
echo You must set the SSH_HOST environment variable
|
||||||
ERROR=1
|
ERROR=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# shellcheck disable=2154 # 2154 irrelevant because the ENV variable should come from container invokation
|
||||||
if [ "${REMOTE_HOST}" = "" ] ; then
|
if [ "${REMOTE_HOST}" = "" ] ; then
|
||||||
echo You must set the REMOTE_HOST environment variable
|
echo You must set the REMOTE_HOST environment variable
|
||||||
ERROR=1
|
ERROR=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# shellcheck disable=2154 # 2154 irrelevant because the ENV variable should come from container invokation
|
||||||
if [ "${REMOTE_PORT}" = "" ] ; then
|
if [ "${REMOTE_PORT}" = "" ] ; then
|
||||||
echo You must set the REMOTE_PORT environment variable
|
echo You must set the REMOTE_PORT environment variable
|
||||||
ERROR=1
|
ERROR=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# shellcheck disable=2154 # 2154 irrelevant because the ENV variable should come from container invokation
|
||||||
if [ "${LOCAL_PORT}" = "" ] ; then
|
if [ "${LOCAL_PORT}" = "" ] ; then
|
||||||
echo You must set the LOCAL_PORT environment variable
|
echo You must set the LOCAL_PORT environment variable
|
||||||
ERROR=1
|
ERROR=1
|
||||||
@@ -42,10 +48,10 @@ fi
|
|||||||
|
|
||||||
while true ; do
|
while true ; do
|
||||||
ssh \
|
ssh \
|
||||||
-p ${SSH_PORT} -i ${SSH_IDENTITY_PATH} \
|
-p "${SSH_PORT}" -i "${SSH_IDENTITY_PATH}" \
|
||||||
-o StrictHostKeyChecking=no -N \
|
-o StrictHostKeyChecking=no -N \
|
||||||
-L 0.0.0.0:${LOCAL_PORT}:${REMOTE_HOST}:${REMOTE_PORT} \
|
-L "0.0.0.0:${LOCAL_PORT}:${REMOTE_HOST}:${REMOTE_PORT}" \
|
||||||
${SSH_USER}@${SSH_HOST}
|
"${SSH_USER}@${SSH_HOST}"
|
||||||
echo "Connection closed. Waiting 5 seconds before retry."
|
echo "Connection closed. Waiting 5 seconds before retry."
|
||||||
sleep 5s
|
sleep 5s
|
||||||
done
|
done
|
||||||
Reference in New Issue
Block a user