Explorar o código

Added fix specific to stationeers. Causes var to be overwritten

Daniel Gibbs %!s(int64=8) %!d(string=hai) anos
pai
achega
7c9b4fc8ac
Modificáronse 1 ficheiros con 6 adicións e 1 borrados
  1. 6 1
      lgsm/functions/install_config.sh

+ 6 - 1
lgsm/functions/install_config.sh

@@ -61,7 +61,12 @@ fn_set_config_vars(){
 		echo "changing hostname."
 		fn_script_log_info "changing hostname."
 		sleep 1
-		sed -i "s/SERVERNAME/${servername}/g" "${servercfgfullpath}"
+
+		if [ $(grep SERVERNAME=SERVERNAME \"${lgsmdir}/config-default/config-game/${config}\") ]; then
+			sed -i "s/SERVERNAME=SERVERNAME/SERVERNAME=${servername}/g" "${servercfgfullpath}"
+		else
+			sed -i "s/SERVERNAME/${servername}/g" "${servercfgfullpath}"
+		fi
 		echo "changing rcon/admin password."
 		fn_script_log_info "changing rcon/admin password."
 		sed -i "s/ADMINPASSWORD/${rconpass}/g" "${servercfgfullpath}"