diff --git a/lgsm/functions/command_start.sh b/lgsm/functions/command_start.sh index 21b554a74..ab93a9e0b 100755 --- a/lgsm/functions/command_start.sh +++ b/lgsm/functions/command_start.sh @@ -165,7 +165,7 @@ fn_start_tmux(){ fn_print_ok "${servername}" fn_script_log_pass "Started ${servername}" fi - rm "${lgsmlogdir:?}/.${selfname}-tmux-error.tmp" + rm "${lgsmlogdir:?}/.${selfname}-tmux-error.tmp" 2>/dev/null echo -en "\n" } diff --git a/lgsm/functions/core_functions.sh b/lgsm/functions/core_functions.sh index b747cde03..59857e1a3 100755 --- a/lgsm/functions/core_functions.sh +++ b/lgsm/functions/core_functions.sh @@ -39,10 +39,6 @@ else fi } -fn_parms(){ -parms="${startparameters}" -} - core_exit.sh(){ functionfile="${FUNCNAME[0]}" fn_fetch_function diff --git a/lgsm/functions/core_legacy.sh b/lgsm/functions/core_legacy.sh index 2ea30f5a6..e28cb7457 100755 --- a/lgsm/functions/core_legacy.sh +++ b/lgsm/functions/core_legacy.sh @@ -77,3 +77,7 @@ if [ -z "${wsstartmap}" ]; then wscollectionid="${ws_start_map}" fi fi + +fn_parms(){ +parms="${startparameters}" +} diff --git a/lgsm/functions/core_messages.sh b/lgsm/functions/core_messages.sh index a56ade188..8dfca6661 100755 --- a/lgsm/functions/core_messages.sh +++ b/lgsm/functions/core_messages.sh @@ -116,7 +116,7 @@ fn_script_log_info(){ fi } -## Feb 28 14:56:58 ut99-server: Monitor: INFO: +## Feb 28 14:56:58 ut99-server: Monitor: UPDATE: fn_script_log_update(){ if [ -d "${lgsmlogdir}" ]; then if [ -n "${commandname}" ]; then diff --git a/lgsm/functions/fix.sh b/lgsm/functions/fix.sh index 654ddd391..1b5e63db6 100755 --- a/lgsm/functions/fix.sh +++ b/lgsm/functions/fix.sh @@ -96,7 +96,7 @@ fi if [ "${commandname}" == "INSTALL" ]; then if [ "${shortname}" == "av" ]||[ "${shortname}" == "cmw" ]||[ "${shortname}" == "kf" ]||[ "${shortname}" == "kf2" ]||[ "${shortname}" == "onset" ]||[ "${shortname}" == "ro" ]||[ "${shortname}" == "samp" ]||[ "${shortname}" == "ut2k4" ]||[ "${shortname}" == "ut" ]||[ "${shortname}" == "ut3" ]; then echo -e "" - echo -e "Applying Post-Install Fixes" + echo -e "${lightyellow}Applying Post-Install Fixes}${default}" echo -e "=================================" fn_sleep_time postinstall=1 diff --git a/lgsm/functions/info_messages.sh b/lgsm/functions/info_messages.sh index ceed4cb00..76a819d07 100755 --- a/lgsm/functions/info_messages.sh +++ b/lgsm/functions/info_messages.sh @@ -610,17 +610,7 @@ fn_info_message_commandlineparms(){ if [ "${serverpassword}" == "NOT SET" ]; then unset serverpassword fi - if grep -qE "^[[:blank:]]*startparameters=" "${configdirserver}/secrets-${selfname}.cfg"; then - eval startparameters="$(sed -nr 's/^ *startparameters=(.*)$/\1/p' "${configdirserver}/secrets-${selfname}.cfg")" - elif grep -qE "^[[:blank:]]*startparameters=" "${configdirserver}/${selfname}.cfg"; then - eval startparameters="$(sed -nr 's/^ *startparameters=(.*)$/\1/p' "${configdirserver}/${selfname}.cfg")" - elif grep -qE "^[[:blank:]]*startparameters=" "${configdirserver}/secrets-common.cfg"; then - eval startparameters="$(sed -nr 's/^ *startparameters=(.*)$/\1/p' "${configdirserver}/secrets-common.cfg")" - elif grep -qE "^[[:blank:]]*startparameters=" "${configdirserver}/common.cfg"; then - eval startparameters="$(sed -nr 's/^ *startparameters=(.*)$/\1/p' "${configdirserver}/common.cfg")" - elif grep -qE "^[[:blank:]]*startparameters=" "${configdirserver}/_default.cfg"; then - eval startparameters="$(sed -nr 's/^ *startparameters=(.*)$/\1/p' "${configdirserver}/_default.cfg")" - fi + fn_reload_startparameters echo -e "${preexecutable} ${executable} ${startparameters}" } diff --git a/lgsm/functions/install_server_files.sh b/lgsm/functions/install_server_files.sh index a6c0cea58..42941078c 100755 --- a/lgsm/functions/install_server_files.sh +++ b/lgsm/functions/install_server_files.sh @@ -87,7 +87,6 @@ elif [ "${shortname}" == "pmc" ]; then install_eula.sh update_papermc.sh elif [ "${shortname}" == "wmc" ]; then - install_eula.sh update_papermc.sh elif [ "${shortname}" == "mumble" ]; then update_mumble.sh diff --git a/linuxgsm.sh b/linuxgsm.sh index 36ef5764c..57e45cfc0 100755 --- a/linuxgsm.sh +++ b/linuxgsm.sh @@ -444,18 +444,28 @@ else # shellcheck source=/dev/null source "${configdirserver}/secrets-${selfname}.cfg" fi - # Use eval if startparameters are only in _default.cfg to ensure all vars in startparameters are set. - if ! grep -qE "^[[:blank:]]*startparameters=" "${configdirserver}/common.cfg" "${configdirserver}/${selfname}.cfg" "${configdirserver}/secrets-common.cfg" "${configdirserver}/secrets-${selfname}.cfg"; then + + # Reloads start parameter to ensure all vars in startparameters are set. + # Will reload the last defined startparameter. + fn_reload_startparameters(){ + # reload Wurm config. if [ "${shortname}" == "wurm" ]; then # shellcheck source=/dev/null source "${servercfgfullpath}" fi - if [ -n "${preexecutable}" ]; then - eval preexecutable="$(sed -nr 's/^ *preexecutable=(.*)$/\1/p' "${configdirserver}/_default.cfg")" + if grep -qE "^[[:blank:]]*startparameters=" "${configdirserver}/secrets-${selfname}.cfg"; then + eval startparameters="$(sed -nr 's/^ *startparameters=(.*)$/\1/p' "${configdirserver}/secrets-${selfname}.cfg")" + elif grep -qE "^[[:blank:]]*startparameters=" "${configdirserver}/${selfname}.cfg"; then + eval startparameters="$(sed -nr 's/^ *startparameters=(.*)$/\1/p' "${configdirserver}/${selfname}.cfg")" + elif grep -qE "^[[:blank:]]*startparameters=" "${configdirserver}/secrets-common.cfg"; then + eval startparameters="$(sed -nr 's/^ *startparameters=(.*)$/\1/p' "${configdirserver}/secrets-common.cfg")" + elif grep -qE "^[[:blank:]]*startparameters=" "${configdirserver}/common.cfg"; then + eval startparameters="$(sed -nr 's/^ *startparameters=(.*)$/\1/p' "${configdirserver}/common.cfg")" + elif grep -qE "^[[:blank:]]*startparameters=" "${configdirserver}/_default.cfg"; then + eval startparameters="$(sed -nr 's/^ *startparameters=(.*)$/\1/p' "${configdirserver}/_default.cfg")" fi - eval startparameters="$(sed -nr 's/^ *startparameters=(.*)$/\1/p' "${configdirserver}/_default.cfg")" - fi + } # Load the linuxgsm.sh in to tmpdir. If missing download it. if [ ! -f "${tmpdir}/linuxgsm.sh" ]; then