From 790fb30018ff4b15f4bdcdef230325251846001e Mon Sep 17 00:00:00 2001 From: Djeeberjr Date: Thu, 23 Feb 2023 22:00:43 +0100 Subject: [PATCH] added SM_ADMIN --- README.md | 2 ++ entrypoint.sh | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/README.md b/README.md index b3841a7..2ce92e7 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,8 @@ `MAP_ROTATION` comma separated list of maps to populate the `mapcycle.txt` and `maplist.txt` files. +`SM_ADMIN` comma separated list of ids to grand admin privileges e.g. "STEAM_0:1:57874277", "!127.0.0.1" + # Custom conVars You can set ANY other variable by just prefixing the conVar with `CVAR_`. So for example if you want to set `mp_disable_autokick 1` just set the enviroment variable `CVAR_MP_DISABLE_AUTOKICK` to `1`. Upper or lower case is ignored. diff --git a/entrypoint.sh b/entrypoint.sh index 6c206a3..126bd4e 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -154,6 +154,14 @@ if [ -n "$WORKSHOP_COLLECTION" ]; then fi fi +mkdir -p "/home/steam/server/csgo/addons/sourcemod/configs/" +echo "// Autogenerated. DO NOT EDIT. Sourcemod admin can be added with the SM_ADMIN environment variable" \ + > "/home/steam/server/csgo/addons/sourcemod/configs/admins_simple.ini" +for id in $(echo "$SM_ADMIN" | sed 's/,/\n/g') +do + echo "\"$id\" \"99:z\"" >> "/home/steam/server/csgo/addons/sourcemod/configs/admins_simple.ini" +done + CVARS=$(env | awk -F "=" '/^CVAR_/ { sub("CVAR_","",$1); print "+"tolower($1),($2 ~ /^[0-9]+$/)?$2:"\""$2"\""," "}' | tr -d "\n") echo "Running command: srcds_run -game csgo $SRCDS_ARGS $CVARS"