prusaslicer-novnc/entrypoint.sh
vajonam f1011cba68 fix: remove ports an some comments.
Signed-off-by: vajonam <152501+vajonam@users.noreply.github.com>
2024-04-03 09:39:49 -04:00

22 lines
702 B
Bash
Executable File

#!/bin/bash -x
set -e
rm -f /tmp/.X*-lock
rm -f /tmp/.X11-unix/X*
DISPLAY=${DISPLAY:-:10}
DISPLAY_NUMBER=$(echo $DISPLAY | cut -d: -f2)
export NOVNC_PORT=${NOVNC_PORT:-8080}
VNC_RESOLUTION=${VNC_RESOLUTION:-1280x800}
if [ -n "$VNC_PASSWORD" ]; then
mkdir -p /root/.vnc
echo "$VNC_PASSWORD" | vncpasswd -f > /root/.vnc/passwd
chmod 0600 /root/.vnc/passwd
export VNC_SEC=
else
export VNC_SEC="-securitytypes TLSNone,X509None,None"
fi
export LOCALFBPORT=$((5900 + DISPLAY_NUMBER))
export VGLRUN=/usr/bin/vglrun
# fix perms and launch supervisor with the above environment variables
chown -R slic3r:slic3r /home/slic3r/ /configs/ /prints/ /dev/stdout && exec gosu slic3r supervisord # -e TRACE