2024-04-03 15:53:43 +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*
|
|
|
|
DISPLAY=${DISPLAY:-:10}
|
|
|
|
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-03 13:27:07 +00:00
|
|
|
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
|
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-03 17:09:07 +00:00
|
|
|
export VGLRUN="${VGLRUN:-/usr/bin/vglrun}"
|
2024-04-03 17:18:19 +00:00
|
|
|
export SUPD_LOGLEVEL="${SUPD_LOGLEVEL:-TRACE}"
|
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
|