shellcheck fix

This commit is contained in:
2025-06-13 08:04:41 +02:00
parent 9daa4e4fd4
commit 1bfcf8fe2c

View File

@@ -2,26 +2,32 @@
ERROR=0
# shellcheck disable=2154 # 2154 irrelevant because the ENV variable should come from container invokation
if [ "${SSH_USER}" = "" ] ; then
echo You must set the SSH_USER environment variable
ERROR=1
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
echo You must set the SSH_HOST environment variable
ERROR=1
fi
# shellcheck disable=2154 # 2154 irrelevant because the ENV variable should come from container invokation
if [ "${REMOTE_HOST}" = "" ] ; then
echo You must set the REMOTE_HOST environment variable
ERROR=1
fi
# shellcheck disable=2154 # 2154 irrelevant because the ENV variable should come from container invokation
if [ "${REMOTE_PORT}" = "" ] ; then
echo You must set the REMOTE_PORT environment variable
ERROR=1
fi
# shellcheck disable=2154 # 2154 irrelevant because the ENV variable should come from container invokation
if [ "${LOCAL_PORT}" = "" ] ; then
echo You must set the LOCAL_PORT environment variable
ERROR=1
@@ -42,10 +48,10 @@ fi
while true ; do
ssh \
-p ${SSH_PORT} -i ${SSH_IDENTITY_PATH} \
-p "${SSH_PORT}" -i "${SSH_IDENTITY_PATH}" \
-o StrictHostKeyChecking=no -N \
-L 0.0.0.0:${LOCAL_PORT}:${REMOTE_HOST}:${REMOTE_PORT} \
${SSH_USER}@${SSH_HOST}
-L "0.0.0.0:${LOCAL_PORT}:${REMOTE_HOST}:${REMOTE_PORT}" \
"${SSH_USER}@${SSH_HOST}"
echo "Connection closed. Waiting 5 seconds before retry."
sleep 5s
done