From a9c28b89ea64f0ea88364b9e349fdbf57e9a014e Mon Sep 17 00:00:00 2001 From: Niklas Date: Sun, 18 Apr 2021 15:25:45 +0200 Subject: [PATCH] motd and host file --- docker-compose.yml | 3 +++ start.sh | 16 ++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index 3101bc3..bce1775 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,6 +7,9 @@ services: - CVAR_HOSTNAME=My left 4 dead server - CVAR_RCON_PASSWORD=password123 - CVAR_MP_DISABLE_AUTOKICK=1 + volume: + - ./motd.txt:/motd.txt:ro + - ./host:txt:/host.txt:ro ports: - 27015:27015 - 27015:27015/udp diff --git a/start.sh b/start.sh index 83ab021..a848aa2 100755 --- a/start.sh +++ b/start.sh @@ -13,6 +13,22 @@ cp $HOME/server.cfg $HOME/server/left4dead2/cfg/server.cfg env | awk -F "=" '/^CVAR_/ {sub("CVAR_","",$1); print tolower($1),($2 ~ /^[0-9]+$/)?$2:"\""$2"\""}' > docker_server.cfg +echo "### Using follwing config: " +cat $HOME/server/left4dead2/cfg/server.cfg +echo "###" + +echo "### Linking host and motd file ### " + +if [[ -f "/motd.txt" ]]; then + rm $HOME/server/left4dead2/motd.txt + ln -sf /motd.txt $HOME/server/left4dead2/motd.txt +fi + +if [[ -f "/host.txt" ]]; then + rm $HOME/server/left4dead2/host.txt + ln -sf /host.txt $HOME/server/left4dead2/host.txt +fi + echo "### Starting l4d2 ###" $HOME/server/srcds_run -console -game left4dead2 +maxplayers 16 -maxclients 16 -ip 0.0.0.0 +map c1m1_hotel +exec docker_server.cfg