mirror of
https://github.com/nestriness/nestri.git
synced 2025-12-11 00:05:36 +02:00
## Description **What issue are you solving (or what feature are you adding) and how are you doing it?** We start the container using supervisord, which is limiting as the user has no way of telling the container what game to run. So, the idea is to run like so: `docker run... ghcr.io/netrisdotme/netris/server:<tag> netris-proton /game/yourgame.exe` Co-authored by @djpremier
24 lines
641 B
Bash
24 lines
641 B
Bash
#!/bin/bash
|
|
#TODO: Fix the warp-input startup problem
|
|
if [ -z "$SESSION_ID" ]; then
|
|
echo "Error: SESSION_ID environment variable is not set."
|
|
exit 1
|
|
fi
|
|
|
|
xarg="$*"
|
|
|
|
if [ -z "$xarg" ]; then
|
|
echo "Error: No command specified to run the game. Exiting."
|
|
exit 1
|
|
fi
|
|
|
|
#Open udp port to listed for QUIC events on
|
|
export PORT=${PORT:-"8080"}
|
|
|
|
escaped_xarg=$(printf '%s\n' "$xarg" | sed -e 's/[\/&]/\\&/g')
|
|
|
|
sudo sed -i "s|^command.*=.*$|command=bash -c \"$escaped_xarg\"|" /etc/supervisord.d/game.ini
|
|
|
|
sudo sed -i 's|^autostart.*=.*$|autostart=true|' /etc/supervisord.d/game.ini
|
|
|
|
sudo -E /usr/bin/supervisord -c /etc/supervisord.conf |