Browse Source

functions changes

pull/4166/head
Daniel Gibbs 4 years ago
parent
commit
41bbd7e04c
  1. 6
      lgsm/functions/core_legacy.sh
  2. 16
      linuxgsm.sh

6
lgsm/functions/core_legacy.sh

@ -78,6 +78,12 @@ if [ -z "${wsstartmap}" ]; then
fi fi
fi fi
# Added as part of changing functions dir to modules dir.
functionsdir="${lgsmdir}/modules"
if [ -d "${lgsmdir}/functions" ]; then
mv "${lgsmdir}/functions" "${lgsmdir}/modules"
fi
fn_parms(){ fn_parms(){
fn_reload_startparameters fn_reload_startparameters
parms="${startparameters}" parms="${startparameters}"

16
linuxgsm.sh

@ -32,7 +32,7 @@ logdir="${rootdir}/log"
lgsmlogdir="${logdir}/lgsm" lgsmlogdir="${logdir}/lgsm"
steamcmddir="${HOME}/.steam/steamcmd" steamcmddir="${HOME}/.steam/steamcmd"
serverfiles="${rootdir}/serverfiles" serverfiles="${rootdir}/serverfiles"
functionsdir="${lgsmdir}/functions" modulesdir="${lgsmdir}/modules"
tmpdir="${lgsmdir}/tmp" tmpdir="${lgsmdir}/tmp"
datadir="${lgsmdir}/data" datadir="${lgsmdir}/data"
lockdir="${lgsmdir}/lock" lockdir="${lgsmdir}/lock"
@ -52,13 +52,13 @@ githubrepo="LinuxGSM"
githubbranch="master" githubbranch="master"
# Core function that is required first. # Core function that is required first.
core_functions.sh(){ core_modules.sh(){
functionfile="${FUNCNAME[0]}" modulefile="${FUNCNAME[0]}"
fn_bootstrap_fetch_file_github "lgsm/functions" "core_functions.sh" "${functionsdir}" "chmodx" "run" "noforcedl" "nomd5" fn_bootstrap_fetch_file_github "lgsm/modules" "core_modules.sh" "${modulesdir}" "chmodx" "run" "noforcedl" "nomd5"
} }
# Bootstrap # Bootstrap
# Fetches the core functions required before passed off to core_dl.sh. # Fetches the core modules required before passed off to core_dl.sh.
fn_bootstrap_fetch_file(){ fn_bootstrap_fetch_file(){
remote_fileurl="${1}" remote_fileurl="${1}"
remote_fileurl_backup="${2}" remote_fileurl_backup="${2}"
@ -319,11 +319,11 @@ if [ "$(whoami)" == "root" ]; then
echo -e "[ FAIL ] Do NOT run this script as root!" echo -e "[ FAIL ] Do NOT run this script as root!"
exit 1 exit 1
fi fi
elif [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]; then elif [ ! -f "${modulesdir}/core_modules.sh" ]||[ ! -f "${modulesdir}/check_root.sh" ]||[ ! -f "${modulesdir}/core_messages.sh" ]; then
echo -e "[ FAIL ] Do NOT run this script as root!" echo -e "[ FAIL ] Do NOT run this script as root!"
exit 1 exit 1
else else
core_functions.sh core_modules.sh
check_root.sh check_root.sh
fi fi
fi fi
@ -369,7 +369,7 @@ if [ "${shortname}" == "core" ]; then
# LinuxGSM server mode. # LinuxGSM server mode.
else else
core_functions.sh core_modules.sh
if [ "${shortname}" != "core-dep" ]; then if [ "${shortname}" != "core-dep" ]; then
# Load LinuxGSM configs. # Load LinuxGSM configs.
# These are required to get all the default variables for the specific server. # These are required to get all the default variables for the specific server.

Loading…
Cancel
Save