|
@ -387,76 +387,75 @@ else |
|
|
else |
|
|
else |
|
|
echo -e "OK" |
|
|
echo -e "OK" |
|
|
fi |
|
|
fi |
|
|
else |
|
|
else |
|
|
function_file_diff=$(diff -q "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg") |
|
|
function_file_diff=$(diff -q "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg") |
|
|
if [ "${function_file_diff}" != "" ]; then |
|
|
if [ "${function_file_diff}" != "" ]; then |
|
|
fn_print_warn_nl "_default.cfg has altered. reloading config." |
|
|
fn_print_warn_nl "_default.cfg has altered. reloading config." |
|
|
echo -en "copying _default.cfg...\c" |
|
|
echo -en "copying _default.cfg...\c" |
|
|
cp -R "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg" |
|
|
cp -R "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg" |
|
|
if [ $? != 0 ]; then |
|
|
if [ $? != 0 ]; then |
|
|
echo -e "FAIL" |
|
|
echo -e "FAIL" |
|
|
exit 1 |
|
|
exit 1 |
|
|
else |
|
|
else |
|
|
echo -e "OK" |
|
|
echo -e "OK" |
|
|
fi |
|
|
|
|
|
fi |
|
|
fi |
|
|
fi |
|
|
fi |
|
|
# Configs have to be loaded twice to allow start startparameters to pick up all vars |
|
|
fi |
|
|
|
|
|
# Configs have to be loaded twice to allow start startparameters to pick up all vars |
|
|
|
|
|
# shellcheck source=/dev/null |
|
|
|
|
|
source "${configdirserver}/_default.cfg" |
|
|
|
|
|
# Load the common.cfg config. If missing download it. |
|
|
|
|
|
if [ ! -f "${configdirserver}/common.cfg" ]; then |
|
|
|
|
|
fn_fetch_config "lgsm/config-default/config-lgsm" "common-template.cfg" "${configdirserver}" "common.cfg" "${chmodx}" "nochmodx" "norun" "noforcedl" "nomd5" |
|
|
|
|
|
# shellcheck source=/dev/null |
|
|
|
|
|
source "${configdirserver}/common.cfg" |
|
|
|
|
|
else |
|
|
|
|
|
# shellcheck source=/dev/null |
|
|
|
|
|
source "${configdirserver}/common.cfg" |
|
|
|
|
|
fi |
|
|
|
|
|
# Load the secrets-common.cfg config. If missing download it. |
|
|
|
|
|
if [ ! -f "${configdirserver}/secrets-common.cfg" ]; then |
|
|
|
|
|
fn_fetch_config "lgsm/config-default/config-lgsm" "secrets-common-template.cfg" "${configdirserver}" "secrets-common.cfg" "${chmodx}" "nochmodx" "norun" "noforcedl" "nomd5" |
|
|
|
|
|
# shellcheck source=/dev/null |
|
|
|
|
|
source "${configdirserver}/secrets-common.cfg" |
|
|
|
|
|
else |
|
|
|
|
|
# shellcheck source=/dev/null |
|
|
|
|
|
source "${configdirserver}/secrets-common.cfg" |
|
|
|
|
|
fi |
|
|
|
|
|
# Load the instance.cfg config. If missing download it. |
|
|
|
|
|
if [ ! -f "${configdirserver}/${selfname}.cfg" ]; then |
|
|
|
|
|
fn_fetch_config "lgsm/config-default/config-lgsm" "instance-template.cfg" "${configdirserver}" "${selfname}.cfg" "nochmodx" "norun" "noforcedl" "nomd5" |
|
|
|
|
|
# shellcheck source=/dev/null |
|
|
|
|
|
source "${configdirserver}/${selfname}.cfg" |
|
|
|
|
|
else |
|
|
|
|
|
# shellcheck source=/dev/null |
|
|
|
|
|
source "${configdirserver}/${selfname}.cfg" |
|
|
|
|
|
fi |
|
|
|
|
|
# Load the secrets-instance.cfg config. If missing download it. |
|
|
|
|
|
if [ ! -f "${configdirserver}/secrets-${selfname}.cfg" ]; then |
|
|
|
|
|
fn_fetch_config "lgsm/config-default/config-lgsm" "secrets-instance-template.cfg" "${configdirserver}" "secrets-${selfname}.cfg" "nochmodx" "norun" "noforcedl" "nomd5" |
|
|
|
|
|
# shellcheck source=/dev/null |
|
|
|
|
|
source "${configdirserver}/secrets-${selfname}.cfg" |
|
|
|
|
|
else |
|
|
|
|
|
# shellcheck source=/dev/null |
|
|
|
|
|
source "${configdirserver}/secrets-${selfname}.cfg" |
|
|
|
|
|
fi |
|
|
|
|
|
if [ -n "$(grep startparameters "${configdirserver}/common.cfg" | sed -e '/^#/d')" ]||[ -n "$(grep startparameters "${configdirserver}/${selfname}.cfg" | sed -e '/^#/d')" ]||[ -n "$(grep startparameters "${configdirserver}/secrets-common.cfg" | sed -e '/^#/d')" ]||[ -n "$(grep startparameters "${configdirserver}/secrets-${selfname}.cfg" | sed -e '/^#/d')" ]; then |
|
|
|
|
|
: |
|
|
|
|
|
else |
|
|
|
|
|
if [ "${shortname}" == "wurm" ]; then |
|
|
# shellcheck source=/dev/null |
|
|
# shellcheck source=/dev/null |
|
|
source "${configdirserver}/_default.cfg" |
|
|
source "${servercfgfullpath}" |
|
|
# Load the common.cfg config. If missing download it. |
|
|
fi |
|
|
if [ ! -f "${configdirserver}/common.cfg" ]; then |
|
|
eval startparameters="$(grep -w startparameters= "${configdirserver}/_default.cfg" | sed -e 's/startparameters=//g')" |
|
|
fn_fetch_config "lgsm/config-default/config-lgsm" "common-template.cfg" "${configdirserver}" "common.cfg" "${chmodx}" "nochmodx" "norun" "noforcedl" "nomd5" |
|
|
eval executable="$(grep -w executable= "${configdirserver}/_default.cfg" | sed -e 's/executable=//g')" |
|
|
# shellcheck source=/dev/null |
|
|
fi |
|
|
source "${configdirserver}/common.cfg" |
|
|
|
|
|
else |
|
|
|
|
|
# shellcheck source=/dev/null |
|
|
|
|
|
source "${configdirserver}/common.cfg" |
|
|
|
|
|
fi |
|
|
|
|
|
# Load the secrets-common.cfg config. If missing download it. |
|
|
|
|
|
if [ ! -f "${configdirserver}/secrets-common.cfg" ]; then |
|
|
|
|
|
fn_fetch_config "lgsm/config-default/config-lgsm" "secrets-common-template.cfg" "${configdirserver}" "secrets-common.cfg" "${chmodx}" "nochmodx" "norun" "noforcedl" "nomd5" |
|
|
|
|
|
# shellcheck source=/dev/null |
|
|
|
|
|
source "${configdirserver}/secrets-common.cfg" |
|
|
|
|
|
else |
|
|
|
|
|
# shellcheck source=/dev/null |
|
|
|
|
|
source "${configdirserver}/secrets-common.cfg" |
|
|
|
|
|
fi |
|
|
|
|
|
# Load the instance.cfg config. If missing download it. |
|
|
|
|
|
if [ ! -f "${configdirserver}/${selfname}.cfg" ]; then |
|
|
|
|
|
fn_fetch_config "lgsm/config-default/config-lgsm" "instance-template.cfg" "${configdirserver}" "${selfname}.cfg" "nochmodx" "norun" "noforcedl" "nomd5" |
|
|
|
|
|
# shellcheck source=/dev/null |
|
|
|
|
|
source "${configdirserver}/${selfname}.cfg" |
|
|
|
|
|
else |
|
|
|
|
|
# shellcheck source=/dev/null |
|
|
|
|
|
source "${configdirserver}/${selfname}.cfg" |
|
|
|
|
|
fi |
|
|
|
|
|
# Load the secrets-instance.cfg config. If missing download it. |
|
|
|
|
|
if [ ! -f "${configdirserver}/secrets-${selfname}.cfg" ]; then |
|
|
|
|
|
fn_fetch_config "lgsm/config-default/config-lgsm" "secrets-instance-template.cfg" "${configdirserver}" "secrets-${selfname}.cfg" "nochmodx" "norun" "noforcedl" "nomd5" |
|
|
|
|
|
# shellcheck source=/dev/null |
|
|
|
|
|
source "${configdirserver}/secrets-${selfname}.cfg" |
|
|
|
|
|
else |
|
|
|
|
|
# shellcheck source=/dev/null |
|
|
|
|
|
source "${configdirserver}/secrets-${selfname}.cfg" |
|
|
|
|
|
fi |
|
|
|
|
|
if [ -n "$(grep startparameters "${configdirserver}/common.cfg" | sed -e '/^#/d')" ]||[ -n "$(grep startparameters "${configdirserver}/${selfname}.cfg" | sed -e '/^#/d')" ]||[ -n "$(grep startparameters "${configdirserver}/secrets-common.cfg" | sed -e '/^#/d')" ]||[ -n "$(grep startparameters "${configdirserver}/secrets-${selfname}.cfg" | sed -e '/^#/d')" ]; then |
|
|
|
|
|
: |
|
|
|
|
|
else |
|
|
|
|
|
if [ "${shortname}" == "wurm" ]; then |
|
|
|
|
|
# shellcheck source=/dev/null |
|
|
|
|
|
source "${servercfgfullpath}" |
|
|
|
|
|
fi |
|
|
|
|
|
eval startparameters="$(grep -w startparameters= "${configdirserver}/_default.cfg" | sed -e 's/startparameters=//g')" |
|
|
|
|
|
eval executable="$(grep -w executable= "${configdirserver}/_default.cfg" | sed -e 's/executable=//g')" |
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
# Load the linuxgsm.sh in to tmpdir. If missing download it. |
|
|
|
|
|
if [ ! -f "${tmpdir}/linuxgsm.sh" ]; then |
|
|
|
|
|
fn_fetch_file_github "" "linuxgsm.sh" "${tmpdir}" "chmodx" "norun" "noforcedl" "nomd5" |
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Load the linuxgsm.sh in to tmpdir. If missing download it. |
|
|
|
|
|
if [ ! -f "${tmpdir}/linuxgsm.sh" ]; then |
|
|
|
|
|
fn_fetch_file_github "" "linuxgsm.sh" "${tmpdir}" "chmodx" "norun" "noforcedl" "nomd5" |
|
|
fi |
|
|
fi |
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
# Enables ANSI colours from core_messages.sh. Can be disabled with ansi=off. |
|
|
# Enables ANSI colours from core_messages.sh. Can be disabled with ansi=off. |
|
|
fn_ansi_loader |
|
|
fn_ansi_loader |
|
|