Update novnc/Dockerfile

This commit is contained in:
myve 2024-07-19 23:29:54 +00:00
commit 41971320aa

View file

@ -8,29 +8,29 @@ RUN apk add --no-cache \
&& <<-'01-init' cat >>/app/init.d/01-init.sh
# Check for client variables
if ! [ ${MYVNC_VNCCLIENT_HOST} ]
if ! [ ${MYVNC_VNCSSH_HOST} ]
then
echo "Variable MYVNC_VNCCLIENT_HOST is missing."
echo "Variable MYVNC_VNCSSH_HOST is missing."
echo "Exiting..."
exit 1
fi
if ! [ ${MYVNC_VNCCLIENT_PORT} ]
if ! [ ${MYVNC_VNCSSH_PORT} ]
then
echo "Variable MYVNC_VNCCLIENT_PORT is missing."
echo "Variable MYVNC_VNCSSH_PORT is missing."
echo "Exiting..."
exit 1
fi
if ! [[ ${MYVNC_VNCCLIENT_PORT} =~ ^[0-9]+$ ]]
if ! [[ ${MYVNC_VNCSSH_PORT} =~ ^[0-9]+$ ]]
then
echo "Variable MYVNC_VNCCLIENT_PORT is invalid."
echo "Variable MYVNC_VNCSSH_PORT is invalid."
echo "Exiting..."
exit 1
fi
# Read ssh client variables hostname and port (5900, 5901, 5902, etc)
if ssh ${MYVNC_VNCCLIENT_HOST} exit
if ssh ${MYVNC_VNCSSH_HOST} exit
then
ssh ${MYVNC_VNCCLIENT_HOST} -L ${MYVNC_VNCLISTEN_HOST:-5900}:localhost:${MYVNC_VNCCLIENT_PORT} &
ssh ${MYVNC_VNCSSH_HOST} -L ${MYVNC_VNCLISTEN_HOST:-5900}:localhost:${MYVNC_VNCSSH_PORT} &
else
echo "Unable to establish SSH tunnel."
echo "Exiting..."