From c3494df3b567134b837eb22d77c0a3ca5a2c3b1b Mon Sep 17 00:00:00 2001 From: Niklas Date: Mon, 26 Apr 2021 13:46:10 +0200 Subject: [PATCH] fill server.cfg directly --- Dockerfile | 1 - docker-compose.yml | 5 ++++- server.cfg | 12 ------------ start.sh | 7 ++----- 4 files changed, 6 insertions(+), 19 deletions(-) delete mode 100644 server.cfg diff --git a/Dockerfile b/Dockerfile index 7938687..360dd61 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,6 @@ FROM cm2network/steamcmd:latest COPY start.sh /home/steam/start.sh -COPY server.cfg /home/steam/server.cfg WORKDIR /home/steam/ diff --git a/docker-compose.yml b/docker-compose.yml index bce1775..902dd4e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,8 +6,11 @@ services: environment: - CVAR_HOSTNAME=My left 4 dead server - CVAR_RCON_PASSWORD=password123 + - CVAR_SV_ALLOW_LOBBY_CONNECT_ONLY=0 + - CVAR_SV_CONSISTENCY=1 + - CAVR_SV_VOICEENABLE=1 - CVAR_MP_DISABLE_AUTOKICK=1 - volume: + volumes: - ./motd.txt:/motd.txt:ro - ./host:txt:/host.txt:ro ports: diff --git a/server.cfg b/server.cfg deleted file mode 100644 index b69de62..0000000 --- a/server.cfg +++ /dev/null @@ -1,12 +0,0 @@ -hostname "Left4Dead2 Server" - -sv_allow_lobby_connect_only "0" - -mp_disable_autokick "1" -sv_alltalk "0" -sv_consistency "1" -sv_voiceenable "1" - -sv_log_onefile "0" -sv_lan "0" -sv_cheats "0" diff --git a/start.sh b/start.sh index a848aa2..6a1ef15 100755 --- a/start.sh +++ b/start.sh @@ -8,10 +8,7 @@ echo "### Installing / Updateing l4d2 ###" echo "### Creating config ###" -cd $HOME/server -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 +env | awk -F "=" '/^CVAR_/ {sub("CVAR_","",$1); print tolower($1),($2 ~ /^[0-9]+$/)?$2:"\""$2"\""}' > $HOME/server/left4dead2/cfg/server.cfg echo "### Using follwing config: " cat $HOME/server/left4dead2/cfg/server.cfg @@ -31,4 +28,4 @@ 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 +$HOME/server/srcds_run -console -game left4dead2 +maxplayers 16 -maxclients 16 -ip 0.0.0.0 +map c1m1_hotel