mirror of
https://github.com/GameServerManagers/LinuxGSM.git
synced 2025-01-09 04:27:35 +08:00
fix(config): resolves issue with settings not always picked up in start parameter (#3320)
This commit is contained in:
parent
9765feccb6
commit
bb994660f7
@ -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"
|
||||
}
|
||||
|
||||
|
@ -39,10 +39,6 @@ else
|
||||
fi
|
||||
}
|
||||
|
||||
fn_parms(){
|
||||
parms="${startparameters}"
|
||||
}
|
||||
|
||||
core_exit.sh(){
|
||||
functionfile="${FUNCNAME[0]}"
|
||||
fn_fetch_function
|
||||
|
@ -77,3 +77,7 @@ if [ -z "${wsstartmap}" ]; then
|
||||
wscollectionid="${ws_start_map}"
|
||||
fi
|
||||
fi
|
||||
|
||||
fn_parms(){
|
||||
parms="${startparameters}"
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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}"
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
20
linuxgsm.sh
20
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")"
|
||||
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
|
||||
}
|
||||
|
||||
# Load the linuxgsm.sh in to tmpdir. If missing download it.
|
||||
if [ ! -f "${tmpdir}/linuxgsm.sh" ]; then
|
||||
|
Loading…
Reference in New Issue
Block a user