mirror of
https://github.com/mr-vercetti/docker-svencoop-server.git
synced 2025-01-18 10:25:34 +01:00
Add possibility to change game name and password
This commit is contained in:
parent
9592e6cedd
commit
a163438cbf
@ -14,7 +14,10 @@ ENV LANG=en_US.UTF-8 LANGUAGE=en_US.UTF-8
|
|||||||
ENV APP_DIR="/app"
|
ENV APP_DIR="/app"
|
||||||
ENV STEAMCMD_DIR="${APP_DIR}/Steam/steamcmd"
|
ENV STEAMCMD_DIR="${APP_DIR}/Steam/steamcmd"
|
||||||
ENV SERVER_DIR="${APP_DIR}/server"
|
ENV SERVER_DIR="${APP_DIR}/server"
|
||||||
|
# Startup variables
|
||||||
ENV GAME_PARAMS="-num_edicts 3072 +sv_lan 1 -port 27015 -console -debug;"
|
ENV GAME_PARAMS="-num_edicts 3072 +sv_lan 1 -port 27015 -console -debug;"
|
||||||
|
ENV GAME_NAME=""
|
||||||
|
ENV GAME_PASSWORD=""
|
||||||
|
|
||||||
# Set up user environment
|
# Set up user environment
|
||||||
RUN groupadd -r abc && \
|
RUN groupadd -r abc && \
|
||||||
|
@ -1,5 +1,20 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
echo "Starting Sven Co-Op server..."
|
server_cfg_file="$SERVER_DIR/svencoop/server.cfg"
|
||||||
|
liblist_file="$SERVER_DIR/svencoop/liblist.gam"
|
||||||
|
|
||||||
|
if [[ $GAME_NAME != "" ]]; then
|
||||||
|
echo "Starting Sven Co-Op server \"$GAME_NAME\""
|
||||||
|
sed -i "s/\/\?\/\?hostname \".*\"/hostname \"$GAME_NAME\"/" $server_cfg_file
|
||||||
|
sed -i "s/\/\?\/\?game \".*\"/game \"$GAME_NAME\"/" $liblist_file
|
||||||
|
else
|
||||||
|
echo "Starting Sven Co-Op server"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $GAME_PASSWORD != "" ]]; then
|
||||||
|
echo "Password protection enabled"
|
||||||
|
sed -i "s/\/\?\/\?sv_password \".*\"/sv_password \"$GAME_PASSWORD\"/" $server_cfg_file
|
||||||
|
fi
|
||||||
|
|
||||||
cd ${SERVER_DIR}
|
cd ${SERVER_DIR}
|
||||||
${SERVER_DIR}/svends_run ${GAME_PARAMS}
|
${SERVER_DIR}/svends_run ${GAME_PARAMS}
|
Loading…
Reference in New Issue
Block a user