diff --git a/README.md b/README.md index 1c80bb1..4166d6b 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ Left 4 dead 2 server. With Metamod and Sourcemod. +[Github](https://github.com/Djeeberjr/l4d2-docker) + # Ports - 27015 - 27015/udp @@ -16,5 +18,7 @@ Try to avoid variables with the word `CVAR_` and avoid `=` in it. A list of available cvars can be found [here](https://developer.valvesoftware.com/wiki/List_of_L4D2_Cvars). +Add your steam ids to `SM_ADMIN` to be added as a sourcemod admin. + If there is a new version of Metamod or Sourcemod and is not yet set in the image you can manually set the download URL in `METAMOD_DL_URL` and `SOURCEMOD_DL_URL`. It will only get update if the addon directory is empty. diff --git a/docker-compose.yml b/docker-compose.yml index 31fac74..896cd07 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -10,6 +10,7 @@ services: - CVAR_SV_CONSISTENCY=0 - CAVR_SV_VOICEENABLE=1 - CVAR_MP_DISABLE_AUTOKICK=1 + - SM_ADMIN=STEAM_0:1:123,STEAM_0:1:456 - INSECURE=true - "MOTD_FILE_CONTENT=Put your MODT here. \n Multiline is also supported." diff --git a/start.sh b/start.sh index 54bbb00..e029783 100755 --- a/start.sh +++ b/start.sh @@ -17,6 +17,16 @@ if [ ! -e "$HOME/server/left4dead2/addons/metamod.vdf" ]; then rm /tmp/sourcemod.tar.gz fi + +mkdir -p "$HOME/server/left4dead2/addons/sourcemod/configs/" +echo "// Autogenerated. DO NOT EDIT. Sourcemod admin can be added with the SM_ADMIN environment variable" \ + > "$HOME/server/left4dead2/addons/sourcemod/configs/admins_simple.ini" +for id in $(echo "$SM_ADMIN" | sed 's/,/\n/g') +do + echo "\"$id\" \"99:z\"" >> "$HOME/server/left4dead2/addons/sourcemod/configs/admins_simple.ini" +done + + echo -n "$MOTD_FILE_CONTENT" > "$HOME/server/left4dead2/motd.txt" echo -n "$HOST_FILE_CONTENT" > "$HOME/server/left4dead2/host.txt"