diff --git a/lgsm/modules/fix_dst.sh b/lgsm/modules/fix_dst.sh index ff963d342..a36435773 100644 --- a/lgsm/modules/fix_dst.sh +++ b/lgsm/modules/fix_dst.sh @@ -15,3 +15,15 @@ if [ -f "/etc/redhat-release" ] && [ ! -f "${serverfiles}/bin/lib32/libcurl-gnut ln -s "/usr/lib/libcurl.so.4" "${serverfiles}/bin/lib32/libcurl-gnutls.so.4" fn_fix_msg_end fi + +# Keeps shard name in server.ini the same as in the LinuxGSM config. +if [ -f "${servercfgfullpath}" ]; then + if [ "$(grep -Ec '^name[[:space:]]*=' "${servercfgfullpath}")" -eq 1 ]; then + if [ "$(grep -E '^name[[:space:]]*=' "${servercfgfullpath}" | cut -d '=' -f2 | tr -d '"' | tr -d ' ')" != "${shard}" ]; then + fixname="update server.ini shard name" + fn_fix_msg_start + sed -i -e "s/name[[:space:]]*=.*/name = \"${shard}\"/g" "${servercfgfullpath}" + fn_fix_msg_end + fi + fi +fi diff --git a/lgsm/modules/info_game.sh b/lgsm/modules/info_game.sh index 2853b8bc5..5536b9840 100644 --- a/lgsm/modules/info_game.sh +++ b/lgsm/modules/info_game.sh @@ -435,7 +435,6 @@ fn_info_game_dodr() { fn_info_game_dst() { if [ -f "${servercfgfullpath}" ]; then fn_info_game_ini "port" "server_port" "${servercfgfullpath}" - fn_info_game_ini "shard" "name" "${servercfgfullpath}" fn_info_game_ini "steamauthport" "authentication_port" "${servercfgfullpath}" fn_info_game_ini "steamport" "master_server_port" "${servercfgfullpath}" fi diff --git a/lgsm/modules/install_config.sh b/lgsm/modules/install_config.sh index 003dc0b09..1624abea4 100644 --- a/lgsm/modules/install_config.sh +++ b/lgsm/modules/install_config.sh @@ -33,7 +33,7 @@ fn_default_config_remote() { echo -e "" echo -e "${bold}${lightyellow}Downloading ${gamename} Configs${default}" echo -e "${bold}=================================${default}" - echo -e "Default configs are downloaded from:" + echo -e "Downloading default configs from:" echo -e "" echo -e "${italic}https://github.com/GameServerManagers/Game-Server-Configs${default}" echo -e "" @@ -48,8 +48,8 @@ fn_default_config_remote() { if [ "${shortname}" == "arma3" ] && [ "${config}" == "${networkcfgdefault}" ]; then echo -en "copying config file [ ${italic}${networkcfgfullpath}${default} ]" changes+=$(cp -nv "${lgsmdir}/config-default/config-game/${config}" "${networkcfgfullpath}") - elif [ "${shortname}" == "dst" ] && [ "${config}" == "${clustercfgdefault}" ]; then - echo -en "copying config file [ ${italic}${clustercfgdefault}${default} ]" + elif [ "${shortname}" == "dst" ] && [ "${config}" == "${clustercfgfullpath}" ]; then + echo -en "copying config file [ ${italic}${clustercfgfullpath}${default} ]" changes+=$(cp -nv "${lgsmdir}/config-default/config-game/${clustercfgdefault}" "${clustercfgfullpath}") else echo -en "copying config file [ ${italic}${servercfgdir}/${config}${default} ]" @@ -70,6 +70,10 @@ fn_default_config_remote() { # Copys local default config to server config location. fn_default_config_local() { + echo -e "" + echo -e "${bold}${lightyellow}Copying ${gamename} Configs${default}" + echo -e "${bold}=================================${default}" + echo -e "Copying default configs." fn_check_cfgdir echo -en "copying config file [ ${italic}${servercfgdefault}${default} ]" cp -n "${servercfgdir}/${servercfgdefault}" "${servercfgfullpath}"