Disable VNC if 'WEB_UI_MODE' is not "vnc"

Se the new variable to default to "vnc"
This commit is contained in:
Josh.5
2022-09-17 17:46:45 +12:00
committed by Josh Sunnex
parent 444cfae3fa
commit 5d2ece84dc
3 changed files with 9 additions and 4 deletions

View File

@@ -441,7 +441,7 @@ ENV \
# Set container configuration environment variables
ENV \
MODE="primary" \
ENABLE_VNC_AUDIO="true"
WEB_UI_MODE="vnc" \
# Configure required ports
ENV \

View File

@@ -1,7 +1,11 @@
echo "**** Configure VNC audio ****"
echo "**** Configure VNC ****"
if ([ ${WEB_UI_MODE} = "vnc" ] && [ "${MODE}" != "s" ] && [ "${MODE}" != "secondary" ]); then
echo "Enable VNC server"
sed -i 's|^autostart.*=.*$|autostart=true|' /etc/supervisor.d/vnc.ini
if [ "${MODE}" != "s" ] & [ "${MODE}" != "secondary" ]; then
if [[ "${ENABLE_VNC_AUDIO}" == "true" ]]; then
# Credits for this audio patch:
# - https://github.com/novnc/noVNC/issues/302
@@ -30,6 +34,7 @@ if [ "${MODE}" != "s" ] & [ "${MODE}" != "secondary" ]; then
# Disable supervisord script
sed -i 's|^autostart.*=.*$|autostart=false|' /etc/supervisor.d/vnc-audio.ini
fi
fi
echo "DONE"

View File

@@ -72,7 +72,7 @@ function configure_x_server {
chmod +x /usr/bin/start-xorg.sh
}
if [ "${MODE}" != "s" ] & [ "${MODE}" != "secondary" ]; then
if ([ "${MODE}" != "s" ] && [ "${MODE}" != "secondary" ]); then
if [[ -z ${nvidia_gpu_hex_id} ]]; then
echo "**** Generate default xorg.conf ****";
configure_x_server