Make use of sed DRY and tidy up cs2 execution for readability
This commit is contained in:
parent
3c483ec15f
commit
1508d10f64
1 changed files with 19 additions and 16 deletions
|
@ -10,10 +10,10 @@ bash "${STEAMCMDDIR}/steamcmd.sh" +force_install_dir "${STEAMAPPDIR}" \
|
||||||
|
|
||||||
# Install server.cfg
|
# Install server.cfg
|
||||||
cp /etc/server.cfg "${STEAMAPPDIR}"/game/csgo/cfg/server.cfg
|
cp /etc/server.cfg "${STEAMAPPDIR}"/game/csgo/cfg/server.cfg
|
||||||
sed -i "s/{{SERVER_HOSTNAME}}/${CS2_SERVERNAME}/g" "${STEAMAPPDIR}"/game/csgo/cfg/server.cfg
|
sed -i -e "s/{{SERVER_HOSTNAME}}/${CS2_SERVERNAME}/g" "${STEAMAPPDIR}"/game/csgo/cfg/server.cfg \
|
||||||
sed -i "s/{{SERVER_PW}}/${CS2_PW}/g" "${STEAMAPPDIR}"/game/csgo/cfg/server.cfg
|
-e "s/{{SERVER_PW}}/${CS2_PW}/g" "${STEAMAPPDIR}"/game/csgo/cfg/server.cfg \
|
||||||
sed -i "s/{{SERVER_RCON_PW}}/${CS2_RCONPW}/g" "${STEAMAPPDIR}"/game/csgo/cfg/server.cfg
|
-e "s/{{SERVER_RCON_PW}}/${CS2_RCONPW}/g" "${STEAMAPPDIR}"/game/csgo/cfg/server.cfg \
|
||||||
sed -i "s/{{SERVER_LAN}}/${CS2_LAN}/g" "${STEAMAPPDIR}"/game/csgo/cfg/server.cfg
|
-e "s/{{SERVER_LAN}}/${CS2_LAN}/g" "${STEAMAPPDIR}"/game/csgo/cfg/server.cfg
|
||||||
|
|
||||||
# Rewrite Config Files
|
# Rewrite Config Files
|
||||||
|
|
||||||
|
@ -27,17 +27,20 @@ if [[ ! -z $CS2_BOT_QUOTA_MODE ]] ; then
|
||||||
sed -i "s/bot_quota_mode.*/bot_quota_mode ${CS2_BOT_QUOTA_MODE}/" "${STEAMAPPDIR}"/game/csgo/cfg/*
|
sed -i "s/bot_quota_mode.*/bot_quota_mode ${CS2_BOT_QUOTA_MODE}/" "${STEAMAPPDIR}"/game/csgo/cfg/*
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Switch to server directory
|
||||||
|
cd "${STEAMAPPDIR}/game/bin/linuxsteamrt64"
|
||||||
|
|
||||||
# Start Server
|
# Start Server
|
||||||
|
|
||||||
"${STEAMAPPDIR}/game/bin/linuxsteamrt64/cs2" -dedicated \
|
"./cs2" -dedicated \
|
||||||
-port "${CS2_PORT}" \
|
-port "${CS2_PORT}" \
|
||||||
-console \
|
-console \
|
||||||
-usercon \
|
-usercon \
|
||||||
-maxplayers_override "${CS2_MAXPLAYERS}" \
|
-maxplayers_override "${CS2_MAXPLAYERS}" \
|
||||||
+game_type "${CS2_GAMETYPE}" \
|
+game_type "${CS2_GAMETYPE}" \
|
||||||
+game_mode "${CS2_GAMEMODE}" \
|
+game_mode "${CS2_GAMEMODE}" \
|
||||||
+mapgroup "${CS2_MAPGROUP}" \
|
+mapgroup "${CS2_MAPGROUP}" \
|
||||||
+map "${CS2_STARTMAP}" \
|
+map "${CS2_STARTMAP}" \
|
||||||
+rcon_password "${CS2_RCONPW}" \
|
+rcon_password "${CS2_RCONPW}" \
|
||||||
+sv_password "${CS2_PW}" \
|
+sv_password "${CS2_PW}" \
|
||||||
"${CS2_ADDITIONAL_ARGS}"
|
"${CS2_ADDITIONAL_ARGS}"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue