diff --git a/lgsm/modules/command_install_resources_mta.sh b/lgsm/modules/command_install_resources_mta.sh index 7b1c45d12d..72084f77ae 100755 --- a/lgsm/modules/command_install_resources_mta.sh +++ b/lgsm/modules/command_install_resources_mta.sh @@ -30,3 +30,8 @@ else fn_print_warning_nl "Default resources are not installed when using ./${selfname} auto-install." fn_print_information_nl "To install default resources use ./${selfname} install" fi + +if [ "${firstcommandname}" == "DEFAULT-RESOURCES" ]; then + exitcode=0 + core_exit.sh +fi diff --git a/lgsm/modules/core_dl.sh b/lgsm/modules/core_dl.sh index 1087d44b92..e22766f7cd 100755 --- a/lgsm/modules/core_dl.sh +++ b/lgsm/modules/core_dl.sh @@ -314,6 +314,7 @@ fn_dl_extract() { fn_script_log_fail "Extracting ${local_filename}" fn_script_log_fail "File ${local_filedir}/${local_filename} not found" core_exit.sh + return 1 fi mime=$(file -b --mime-type "${local_filedir}/${local_filename}") if [ "${mime}" == "application/gzip" ] || [ "${mime}" == "application/x-gzip" ]; then @@ -359,6 +360,7 @@ fn_dl_extract() { fi echo -e "${extractcmd}" core_exit.sh + return 1 else fn_print_ok_eol_nl fn_script_log_pass "Extracting ${local_filename}" diff --git a/lgsm/modules/core_steamcmd.sh b/lgsm/modules/core_steamcmd.sh index 81b8d0cc23..d8043ed269 100755 --- a/lgsm/modules/core_steamcmd.sh +++ b/lgsm/modules/core_steamcmd.sh @@ -15,7 +15,7 @@ fn_install_steamcmd() { mkdir -p "${steamcmddir}" fi fn_fetch_file "https://media.steampowered.com/client/steamcmd_linux.tar.gz" "" "" "" "${tmpdir}" "steamcmd_linux.tar.gz" "nochmodx" "norun" "noforce" "nohash" - fn_dl_extract "${tmpdir}" "steamcmd_linux.tar.gz" "${steamcmddir}" + fn_dl_extract "${tmpdir}" "steamcmd_linux.tar.gz" "${steamcmddir}" || return 1 chmod +x "${steamcmddir}/steamcmd.sh" } diff --git a/lgsm/modules/install_logs.sh b/lgsm/modules/install_logs.sh index 9e1b89dbdf..987e7e8937 100755 --- a/lgsm/modules/install_logs.sh +++ b/lgsm/modules/install_logs.sh @@ -17,6 +17,7 @@ echo -en "creating log directory [ ${italic}${logdir}${default} ]" if [ ! -d "${logdir}" ]; then if ! mkdir -p "${logdir}"; then fn_print_fail_eol_nl + fn_script_log_fail "Creating log directory ${logdir}" core_exit.sh else fn_print_ok_eol_nl @@ -29,6 +30,7 @@ echo -en "creating script log directory [ ${italic}${lgsmlogdir}${default} ]" if [ ! -d "${lgsmlogdir}" ]; then if ! mkdir -p "${lgsmlogdir}"; then fn_print_fail_eol_nl + fn_script_log_fail "Creating script log directory ${lgsmlogdir}" core_exit.sh else fn_print_ok_eol_nl @@ -41,6 +43,7 @@ echo -en "creating script log [ ${italic}${lgsmlog}${default} ]" if [ ! -f "${lgsmlog}" ]; then if ! touch "${lgsmlog}"; then fn_print_fail_eol_nl + fn_script_log_fail "Creating script log ${lgsmlog}" core_exit.sh else fn_print_ok_eol_nl @@ -53,6 +56,7 @@ echo -en "creating console log directory [ ${italic}${consolelogdir}${default} ] if [ ! -d "${consolelogdir}" ]; then if ! mkdir -p "${consolelogdir}"; then fn_print_fail_eol_nl + fn_script_log_fail "Creating console log directory ${consolelogdir}" core_exit.sh else fn_print_ok_eol_nl @@ -65,6 +69,7 @@ echo -en "creating console log [ ${italic}${consolelog}${default} ]" if [ ! -f "${consolelog}" ]; then if ! touch "${consolelog}"; then fn_print_fail_eol_nl + fn_script_log_fail "Creating console log ${consolelog}" core_exit.sh else fn_print_ok_eol_nl @@ -78,6 +83,7 @@ if [ -n "${gamelogdir}" ]; then if [ ! -d "${gamelogdir}" ]; then if ! mkdir -p "${gamelogdir}"; then fn_print_fail_eol_nl + fn_script_log_fail "Creating game log directory ${gamelogdir}" core_exit.sh else fn_print_ok_eol_nl @@ -97,6 +103,7 @@ if [ -n "${gamelogdir}" ] && [ "${gamelogdir:0:${#logdir}}" != "${logdir}" ]; th if [ ! -h "${logdir}/server" ] || [ "$(readlink -f "${logdir}/server")" != "${gamelogdir}" ]; then if ! ln -nfs "${gamelogdir}" "${logdir}/server"; then fn_print_fail_eol_nl + fn_script_log_fail "Creating symlink to game log directory ${logdir}/server" core_exit.sh else fn_print_ok_eol_nl @@ -112,6 +119,7 @@ if [ -d "${HOME}/.steam/steam/logs" ]; then if [ ! -L "${logdir}/steam" ]; then if ! ln -nfs "${HOME}/.steam/steam/logs" "${logdir}/steam"; then fn_print_fail_eol_nl + fn_script_log_fail "Creating symlink to steam log directory ${logdir}/steam" core_exit.sh else fn_print_ok_eol_nl diff --git a/lgsm/modules/update_bb.sh b/lgsm/modules/update_bb.sh index aeb47fe448..51b3f76d33 100755 --- a/lgsm/modules/update_bb.sh +++ b/lgsm/modules/update_bb.sh @@ -9,7 +9,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_update_dl() { # Download and extract files to serverfiles. - fn_fetch_file "${remotebuildurl}" "" "" "" "${tmpdir}" "${remotebuildfilename}" "nochmodx" "norun" "force" "${remotebuildhash}" + fn_fetch_file "${remotebuildurl}" "" "" "" "${tmpdir}" "${remotebuildfilename}" "nochmodx" "norun" "forcedl" "${remotebuildhash}" fn_dl_extract "${tmpdir}" "${remotebuildfilename}" "${serverfiles}" echo "${remotebuild}" > "${serverfiles}/build.txt" fn_clear_tmp diff --git a/lgsm/modules/update_etl.sh b/lgsm/modules/update_etl.sh index fa3f9f591f..e44c058f8d 100755 --- a/lgsm/modules/update_etl.sh +++ b/lgsm/modules/update_etl.sh @@ -9,7 +9,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_update_dl() { # Download and extract files to serverfiles. - fn_fetch_file "${remotebuildurl}" "" "" "" "${tmpdir}" "${remotebuildfilename}" "nochmodx" "norun" "force" "${remotebuildhash}" + fn_fetch_file "${remotebuildurl}" "" "" "" "${tmpdir}" "${remotebuildfilename}" "nochmodx" "norun" "forcedl" "${remotebuildhash}" fn_dl_extract "${tmpdir}" "${remotebuildfilename}" "${serverfiles}" echo "${remotebuild}" > "${serverfiles}/build.txt" fn_clear_tmp diff --git a/lgsm/modules/update_fctr.sh b/lgsm/modules/update_fctr.sh index d82f53881f..8b065738ea 100755 --- a/lgsm/modules/update_fctr.sh +++ b/lgsm/modules/update_fctr.sh @@ -9,7 +9,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_update_dl() { # Download and extract files to serverfiles. - fn_fetch_file "${remotebuildurl}" "" "" "" "${tmpdir}" "${remotebuildfilename}" "nochmodx" "norun" "force" "nohash" + fn_fetch_file "${remotebuildurl}" "" "" "" "${tmpdir}" "${remotebuildfilename}" "nochmodx" "norun" "forcedl" "nohash" fn_dl_extract "${tmpdir}" "factorio_headless_${factorioarch}-${remotebuild}.tar.xz" "${serverfiles}" "factorio" fn_clear_tmp } diff --git a/lgsm/modules/update_jk2.sh b/lgsm/modules/update_jk2.sh index 1d2ba36458..930f5ea98d 100755 --- a/lgsm/modules/update_jk2.sh +++ b/lgsm/modules/update_jk2.sh @@ -9,7 +9,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_update_dl() { # Download and extract files to serverfiles. - fn_fetch_file "${remotebuildurl}" "" "" "" "${tmpdir}" "${remotebuildfilename}" "nochmodx" "norun" "force" "nohash" + fn_fetch_file "${remotebuildurl}" "" "" "" "${tmpdir}" "${remotebuildfilename}" "nochmodx" "norun" "forcedl" "nohash" fn_dl_extract "${tmpdir}" "${remotebuildfilename}" "${serverfiles}/GameData" "linux-amd64" fn_clear_tmp } diff --git a/lgsm/modules/update_mta.sh b/lgsm/modules/update_mta.sh index 5adbc57ed7..353dca9d07 100755 --- a/lgsm/modules/update_mta.sh +++ b/lgsm/modules/update_mta.sh @@ -9,7 +9,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_update_dl() { # Download and extract files to tmpdir. - fn_fetch_file "https://linux.multitheftauto.com/dl/multitheftauto_linux_x64.tar.gz" "" "" "" "${tmpdir}" "multitheftauto_linux_x64.tar.gz" "nochmodx" "norun" "force" "nohash" + fn_fetch_file "https://linux.multitheftauto.com/dl/multitheftauto_linux_x64.tar.gz" "" "" "" "${tmpdir}" "multitheftauto_linux_x64.tar.gz" "nochmodx" "norun" "forcedl" "nohash" fn_dl_extract "${tmpdir}" "multitheftauto_linux_x64.tar.gz" "${serverfiles}" "multitheftauto_linux_x64" fn_clear_tmp } diff --git a/lgsm/modules/update_pmc.sh b/lgsm/modules/update_pmc.sh index 907e32dbe0..a5185e6929 100755 --- a/lgsm/modules/update_pmc.sh +++ b/lgsm/modules/update_pmc.sh @@ -9,7 +9,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_update_dl() { # Download and extract files to serverfiles. - fn_fetch_file "${remotebuildurl}" "" "" "" "${tmpdir}" "${remotebuildfilename}" "chmodx" "norun" "force" "${remotebuildhash}" + fn_fetch_file "${remotebuildurl}" "" "" "" "${tmpdir}" "${remotebuildfilename}" "chmodx" "norun" "forcedl" "${remotebuildhash}" cp -f "${tmpdir}/${remotebuildfilename}" "${serverfiles}/${executable#./}" echo "${remotebuild}" > "${serverfiles}/build.txt" fn_clear_tmp diff --git a/lgsm/modules/update_ts3.sh b/lgsm/modules/update_ts3.sh index 58ad872b25..92136ed5d4 100755 --- a/lgsm/modules/update_ts3.sh +++ b/lgsm/modules/update_ts3.sh @@ -9,7 +9,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_update_dl() { # Download and extract files to serverfiles. - fn_fetch_file "${remotebuildurl}" "" "" "" "${tmpdir}" "${remotebuildfilename}" "nochmodx" "norun" "force" "${remotebuildhash}" + fn_fetch_file "${remotebuildurl}" "" "" "" "${tmpdir}" "${remotebuildfilename}" "nochmodx" "norun" "forcedl" "${remotebuildhash}" fn_dl_extract "${tmpdir}" "${remotebuildfilename}" "${serverfiles}" "teamspeak3-server_linux_${ts3arch}" fn_clear_tmp } diff --git a/lgsm/modules/update_ut99.sh b/lgsm/modules/update_ut99.sh index f21117125b..ce8158d05f 100755 --- a/lgsm/modules/update_ut99.sh +++ b/lgsm/modules/update_ut99.sh @@ -9,7 +9,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_update_dl() { # Download and extract files to serverfiles. - fn_fetch_file "${remotebuildurl}" "" "" "" "${tmpdir}" "${remotebuildfilename}" "nochmodx" "norun" "force" "nohash" + fn_fetch_file "${remotebuildurl}" "" "" "" "${tmpdir}" "${remotebuildfilename}" "nochmodx" "norun" "forcedl" "nohash" fn_dl_extract "${tmpdir}" "${remotebuildfilename}" "${serverfiles}" echo "${remotebuild}" > "${serverfiles}/build.txt" fn_clear_tmp diff --git a/lgsm/modules/update_vints.sh b/lgsm/modules/update_vints.sh index 0925e6f801..6f2da81ebd 100755 --- a/lgsm/modules/update_vints.sh +++ b/lgsm/modules/update_vints.sh @@ -9,7 +9,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_update_dl() { # Download and extract files to serverfiles. - fn_fetch_file "${remotebuildurl}" "" "" "" "${tmpdir}" "${remotebuildfilename}" "nochmodx" "norun" "force" "${remotebuildhash}" + fn_fetch_file "${remotebuildurl}" "" "" "" "${tmpdir}" "${remotebuildfilename}" "nochmodx" "norun" "forcedl" "${remotebuildhash}" rm -rf "${serverfiles:?}/assets" fn_dl_extract "${tmpdir}" "${remotebuildfilename}" "${serverfiles}" fn_clear_tmp diff --git a/lgsm/modules/update_xnt.sh b/lgsm/modules/update_xnt.sh index 831f63325e..751709e8bf 100755 --- a/lgsm/modules/update_xnt.sh +++ b/lgsm/modules/update_xnt.sh @@ -9,7 +9,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_update_dl() { # Download and extract files to serverfiles. - fn_fetch_file "${remotebuildurl}" "" "" "" "${tmpdir}" "${remotebuildfilename}" "nochmodx" "norun" "force" "${remotebuildhash}" + fn_fetch_file "${remotebuildurl}" "" "" "" "${tmpdir}" "${remotebuildfilename}" "nochmodx" "norun" "forcedl" "${remotebuildhash}" fn_dl_extract "${tmpdir}" "${remotebuildfilename}" "${serverfiles}" "Xonotic" fn_clear_tmp }