Browse Source

fix(config): resolves issue with settings not always picked up in start parameter (#3320)

pull/3338/head
Daniel Gibbs 4 years ago
committed by GitHub
parent
commit
bb994660f7
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      lgsm/functions/command_start.sh
  2. 4
      lgsm/functions/core_functions.sh
  3. 4
      lgsm/functions/core_legacy.sh
  4. 2
      lgsm/functions/core_messages.sh
  5. 2
      lgsm/functions/fix.sh
  6. 12
      lgsm/functions/info_messages.sh
  7. 1
      lgsm/functions/install_server_files.sh
  8. 22
      linuxgsm.sh

2
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"
}

4
lgsm/functions/core_functions.sh

@ -39,10 +39,6 @@ else
fi
}
fn_parms(){
parms="${startparameters}"
}
core_exit.sh(){
functionfile="${FUNCNAME[0]}"
fn_fetch_function

4
lgsm/functions/core_legacy.sh

@ -77,3 +77,7 @@ if [ -z "${wsstartmap}" ]; then
wscollectionid="${ws_start_map}"
fi
fi
fn_parms(){
parms="${startparameters}"
}

2
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

2
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

12
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}"
}

1
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

22
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

Loading…
Cancel
Save