Skip to content

Commit

Permalink
Merge pull request #51 from Soren90/master
Browse files Browse the repository at this point in the history
Add config before updating server
  • Loading branch information
kaimallea committed Apr 25, 2021
2 parents 451b388 + 7733282 commit 271dfe3
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions containerfs/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,11 @@ export RETAKES="${RETAKES:-0}"
export ANNOUNCEMENT_IP="${ANNOUNCEMENT_IP:-}"
export NOMASTER="${NOMASTER:-}"

# Attempt to update CSGO before starting the server

[[ -z ${CI+x} ]] && "$STEAMCMD_DIR/steamcmd.sh" +login anonymous +force_install_dir "$CSGO_DIR" +app_update "$CSGO_APP_ID" +quit

# Create dynamic autoexec config
if [ ! "$CSGO_DIR/csgo/cfg/autoexec.cfg" ]; then
mkdir -p "$CSGO_DIR/csgo/cfg"

if [ ! -f "$CSGO_DIR/csgo/cfg/autoexec.cfg" ]; then
cat << AUTOEXECCFG > "$CSGO_DIR/csgo/cfg/autoexec.cfg"
log on
hostname "$SERVER_HOSTNAME"
Expand All @@ -53,8 +52,8 @@ sed -i -n 's/^rcon_password.*/rcon_password "$RCON_PASSWORD"/' $CSGO_DIR/csgo/cf
sed -i -n 's/^sv_password.*/sv_password "$SERVER_PASSWORD"/' $CSGO_DIR/csgo/cfg/autoexec.cfg

fi
# Create dynamic server config

# Create dynamic server config
if [ ! -f "$CSGO_DIR/csgo/cfg/server.cfg" ]; then
cat << SERVERCFG > "$CSGO_DIR/csgo/cfg/server.cfg"
tv_enable $TV_ENABLE
Expand All @@ -81,6 +80,9 @@ sed -i -n 's/^tv_enable.*/tv_enable $TV_ENABLE/' $CSGO_DIR/csgo/cfg/server.cfg

fi

# Attempt to update CSGO before starting the server
[[ -z ${CI+x} ]] && "$STEAMCMD_DIR/steamcmd.sh" +login anonymous +force_install_dir "$CSGO_DIR" +app_update "$CSGO_APP_ID" +quit

# Install and configure plugins & extensions
"$BASH" "$STEAM_DIR/manage_plugins.sh"

Expand Down

0 comments on commit 271dfe3

Please sign in to comment.