Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update DCSSB long run to auto update Python packages #92

Merged
merged 3 commits into from
Dec 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion docker/src/s6-services/s6-init-dcssb-auto-start-longrun/run
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,25 @@ 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
wine cmd.exe /c "%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
EOF
Loading