From a4c0b31e7550e400f4ff433226ae2edc98ec34c9 Mon Sep 17 00:00:00 2001 From: Aterfax Date: Tue, 10 Dec 2024 23:22:38 +0000 Subject: [PATCH 1/3] Update DCSSB long run to auto update Python packages --- .../src/s6-services/s6-init-dcssb-auto-start-longrun/run | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/docker/src/s6-services/s6-init-dcssb-auto-start-longrun/run b/docker/src/s6-services/s6-init-dcssb-auto-start-longrun/run index 92411fa..15861dd 100755 --- a/docker/src/s6-services/s6-init-dcssb-auto-start-longrun/run +++ b/docker/src/s6-services/s6-init-dcssb-auto-start-longrun/run @@ -24,7 +24,13 @@ if [ "${DCSSBAUTOSTART}" != "1" ]; then fi # What lies below is cursed. +# First update the venv packages as the DCSSB update.py won't do so due to logic that won't trigger +sudo -E -u abc bash <<'EOF' +wine '%USERPROFILE%\.dcssb\Scripts\python.exe -m pip install -r %USERPROFILE%\DCSServerBot\requirements.txt' +EOF + +# Now start up the bot sudo -E -u abc bash <<'EOF' export DISPLAY=:1.0 # Set the display to the main X server display xfce4-terminal --title=DCSServerbot --default-working-directory=/config/.wine/drive_c/users/abc/DCSServerBot -e 'wine /config/.wine/drive_c/users/abc/DCSServerBot/run.cmd' -EOF \ No newline at end of file +EOF From e5bdcd1d706a6522d619baac5abd15fba06b0648 Mon Sep 17 00:00:00 2001 From: Aterfax Date: Wed, 11 Dec 2024 00:28:57 +0000 Subject: [PATCH 2/3] Enforce a first manual install check --- .../s6-services/s6-init-dcssb-auto-start-longrun/run | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docker/src/s6-services/s6-init-dcssb-auto-start-longrun/run b/docker/src/s6-services/s6-init-dcssb-auto-start-longrun/run index 15861dd..370b2f1 100755 --- a/docker/src/s6-services/s6-init-dcssb-auto-start-longrun/run +++ b/docker/src/s6-services/s6-init-dcssb-auto-start-longrun/run @@ -23,6 +23,17 @@ if [ "${DCSSBAUTOSTART}" != "1" ]; then exit 0 fi +# Define the path to the DCSSB virtual environment +VENV_PATH="/config/.wine/drive_c/users/abc/.dcssb" + +# Check if the directory exists to indicate if the manual first install has happened +if [ ! -d "$VENV_PATH" ]; then + echo "DCSSBAUTOSTART set to auto start but no Python virtual environment appears to exist." + echo "Please ensure you have manually installed DCSServerBot prior to auto starting." + sleep ${TIMEOUT} + exit 1 +fi + # What lies below is cursed. # First update the venv packages as the DCSSB update.py won't do so due to logic that won't trigger sudo -E -u abc bash <<'EOF' From 0bfd40ba344e832def34d0d2c8ea8cd2c1f45131 Mon Sep 17 00:00:00 2001 From: Aterfax Date: Wed, 11 Dec 2024 00:38:23 +0000 Subject: [PATCH 3/3] Fix update cmd. --- docker/src/s6-services/s6-init-dcssb-auto-start-longrun/run | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/src/s6-services/s6-init-dcssb-auto-start-longrun/run b/docker/src/s6-services/s6-init-dcssb-auto-start-longrun/run index 370b2f1..a6a918a 100755 --- a/docker/src/s6-services/s6-init-dcssb-auto-start-longrun/run +++ b/docker/src/s6-services/s6-init-dcssb-auto-start-longrun/run @@ -36,8 +36,8 @@ fi # What lies below is cursed. # First update the venv packages as the DCSSB update.py won't do so due to logic that won't trigger -sudo -E -u abc bash <<'EOF' -wine '%USERPROFILE%\.dcssb\Scripts\python.exe -m pip install -r %USERPROFILE%\DCSServerBot\requirements.txt' +sudo -E -u abc bash <