2024-04-04 14:17:03 +00:00
|
|
|
#!/bin/bash
|
2024-04-03 13:27:07 +00:00
|
|
|
set -e
|
|
|
|
rm -f /tmp/.X*-lock
|
|
|
|
rm -f /tmp/.X11-unix/X*
|
2024-04-03 18:08:20 +00:00
|
|
|
export DISPLAY=${DISPLAY:-:0}
|
2024-04-03 13:27:07 +00:00
|
|
|
DISPLAY_NUMBER=$(echo $DISPLAY | cut -d: -f2)
|
|
|
|
export NOVNC_PORT=${NOVNC_PORT:-8080}
|
2024-04-03 15:41:49 +00:00
|
|
|
export VNC_PORT=${VNC_PORT:-5900}
|
2024-04-04 01:07:10 +00:00
|
|
|
export VNC_RESOLUTION=${VNC_RESOLUTION:-1280x800}
|
2024-04-03 13:27:07 +00:00
|
|
|
if [ -n "$VNC_PASSWORD" ]; then
|
|
|
|
mkdir -p /root/.vnc
|
|
|
|
echo "$VNC_PASSWORD" | vncpasswd -f > /root/.vnc/passwd
|
|
|
|
chmod 0600 /root/.vnc/passwd
|
2024-04-03 13:36:34 +00:00
|
|
|
export VNC_SEC=
|
|
|
|
else
|
|
|
|
export VNC_SEC="-securitytypes TLSNone,X509None,None"
|
2024-04-03 13:27:07 +00:00
|
|
|
fi
|
2024-04-03 15:41:49 +00:00
|
|
|
export LOCALFBPORT=$((${VNC_PORT} + DISPLAY_NUMBER))
|
2024-04-04 14:02:43 +00:00
|
|
|
if [ -n "$ENABLEHWGPU" ] && [ "$ENABLEHWGPU" = "true" ]; then
|
|
|
|
export VGLRUN="/usr/bin/vglrun"
|
|
|
|
else
|
|
|
|
export VGLRUN=
|
|
|
|
fi
|
|
|
|
|
2024-04-03 17:18:19 +00:00
|
|
|
export SUPD_LOGLEVEL="${SUPD_LOGLEVEL:-TRACE}"
|
2024-04-03 17:19:11 +00:00
|
|
|
export VGL_DISPLAY="${VGL_DISPLAY:-egl}"
|
|
|
|
|
2024-04-03 13:39:49 +00:00
|
|
|
# fix perms and launch supervisor with the above environment variables
|
2024-04-03 17:18:19 +00:00
|
|
|
chown -R slic3r:slic3r /home/slic3r/ /configs/ /prints/ /dev/stdout && exec gosu slic3r supervisord -e $SUPD_LOGLEVEL
|