From ed536eade6df23e9e04b31fb58cb5f63aca9eb5c Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Mon, 6 Apr 2020 21:31:22 +0100 Subject: [PATCH] feat(update): multi instance servers will reboot automatically on update (#2800) --- lgsm/functions/check_last_update.sh | 19 +++++++++++++++++++ lgsm/functions/command_backup.sh | 12 ++++++------ lgsm/functions/command_debug.sh | 6 +++--- lgsm/functions/command_monitor.sh | 9 +++++---- lgsm/functions/command_start.sh | 5 ++++- lgsm/functions/command_stop.sh | 4 ++-- lgsm/functions/command_update.sh | 1 + lgsm/functions/core_functions.sh | 10 ++++++++++ lgsm/functions/logs.sh | 5 ++--- lgsm/functions/update_factorio.sh | 1 + lgsm/functions/update_minecraft.sh | 1 + lgsm/functions/update_minecraft_bedrock.sh | 1 + lgsm/functions/update_mta.sh | 1 + lgsm/functions/update_mumble.sh | 1 + lgsm/functions/update_steamcmd.sh | 7 +++++++ linuxgsm.sh | 4 ++-- tests/tests_fctrserver.sh | 8 ++++---- tests/tests_jc2server.sh | 8 ++++---- tests/tests_mcserver.sh | 8 ++++---- tests/tests_shellcheck.sh | 2 +- tests/tests_ts3server.sh | 8 ++++---- 21 files changed, 83 insertions(+), 38 deletions(-) create mode 100644 lgsm/functions/check_last_update.sh diff --git a/lgsm/functions/check_last_update.sh b/lgsm/functions/check_last_update.sh new file mode 100644 index 000000000..55e9f21d2 --- /dev/null +++ b/lgsm/functions/check_last_update.sh @@ -0,0 +1,19 @@ +#!/bin/bash +# LinuxGSM check_last_update.sh function +# Author: Daniel Gibbs +# Website: https://linuxgsm.com +# Description: Checks lock file to see when last update happened. +# Will reboot server if instance not rebooted since update. + +if [ -f "${lockdir}/${selfname}-laststart.lock" ]; then + laststart=$(cat "${lockdir}/${selfname}-laststart.lock") +fi +if [ -f "${lockdir}/lastupdate.lock" ]; then + lastupdate=$(cat "${lockdir}/lastupdate.lock") +fi + +if [ ! -f "${lockdir}/${selfname}-laststart.lock" ]||[ "${laststart}" -lt "${lastupdate}" ]; then + fn_print_info "${selfname} has not been restarted since last update" + fn_script_log_info "${selfname} has not been restarted since last update" + command_restart.sh +fi diff --git a/lgsm/functions/command_backup.sh b/lgsm/functions/command_backup.sh index 724954a2d..a11753127 100644 --- a/lgsm/functions/command_backup.sh +++ b/lgsm/functions/command_backup.sh @@ -22,13 +22,13 @@ fn_backup_trap(){ fn_print_removed_eol_nl fn_script_log_info "Backup ${backupname}.tar.gz: REMOVED" # Remove lock file. - rm -f "${tmpdir:?}/.backup.lock" + rm -f "${lockdir:?}/.backup.lock" core_exit.sh } # Check if a backup is pending or has been aborted using .backup.lock. fn_backup_check_lockfile(){ - if [ -f "${tmpdir}/.backup.lock" ]; then + if [ -f "${lockdir}/.backup.lock" ]; then fn_print_info_nl "Lock file found: Backup is currently running" fn_script_log_error "Lock file found: Backup is currently running: ${tmpdir}/.backup.lock" core_exit.sh @@ -115,9 +115,9 @@ fn_backup_migrate_olddir(){ fn_backup_create_lockfile(){ # Create lockfile. - date '+%s' > "${tmpdir}/.backup.lock" + date '+%s' > "${lockdir}/.backup.lock" fn_script_log_info "Lockfile generated" - fn_script_log_info "${tmpdir}/.backup.lock" + fn_script_log_info "${lockdir}/.backup.lock" # trap to remove lockfile on quit. trap fn_backup_trap INT } @@ -138,7 +138,7 @@ fn_backup_compression(){ core_exit.sh fi - tar -czf "${backupdir}/${backupname}.tar.gz" -C "${rootdir}" --exclude "${excludedir}" --exclude "${tmpdir}/.backup.lock" ./. + tar -czf "${backupdir}/${backupname}.tar.gz" -C "${rootdir}" --exclude "${excludedir}" --exclude "${lockdir}/.backup.lock" ./. local exitcode=$? if [ ${exitcode} -ne 0 ]; then fn_print_fail_eol @@ -152,7 +152,7 @@ fn_backup_compression(){ fn_script_log_pass "Backup created: ${backupname}.tar.gz, total size $(du -sh "${backupdir}/${backupname}.tar.gz" | awk '{print $1}')" fi # Remove lock file - rm -f "${tmpdir:?}/.backup.lock" + rm -f "${lockdir:?}/.backup.lock" } # Clear old backups according to maxbackups and maxbackupdays variables. diff --git a/lgsm/functions/command_debug.sh b/lgsm/functions/command_debug.sh index 9d8110c50..4140ddcdd 100644 --- a/lgsm/functions/command_debug.sh +++ b/lgsm/functions/command_debug.sh @@ -11,7 +11,7 @@ local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") # Trap to remove lockfile on quit. fn_lockfile_trap(){ # Remove lockfile. - rm -f "${rootdir:?}/${lockselfname}" + rm -f "${lockdir:?}/${selfname}.lock" # resets terminal. Servers can sometimes mess up the terminal on exit. reset fn_print_ok_nl "Closing debug" @@ -90,9 +90,9 @@ fn_script_log_info "Starting debug" fn_print_ok_nl "Starting debug" # Create lockfile. -date '+%s' > "${rootdir}/${lockselfname}" +date '+%s' > "${lockdir}/${selfname}.lock" fn_script_log_info "Lockfile generated" -fn_script_log_info "${rootdir}/${lockselfname}" +fn_script_log_info "${lockdir}/${selfname}.lock" # trap to remove lockfile on quit. trap fn_lockfile_trap INT diff --git a/lgsm/functions/command_monitor.sh b/lgsm/functions/command_monitor.sh index ae7d25388..5c4ead99a 100644 --- a/lgsm/functions/command_monitor.sh +++ b/lgsm/functions/command_monitor.sh @@ -12,7 +12,7 @@ local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") fn_monitor_check_lockfile(){ # Monitor does not run it lockfile is not found. - if [ ! -f "${rootdir}/${lockselfname}" ]; then + if [ ! -f "${lockdir}/${selfname}.lock" ]; then fn_print_dots "Checking lockfile: " fn_print_checking_eol fn_script_log_info "Checking lockfile: CHECKING" @@ -26,8 +26,8 @@ fn_monitor_check_lockfile(){ fi # Fix if lockfile is not unix time or contains letters - if [[ "$(cat "${rootdir}/${lockselfname}")" =~ [A-Za-z] ]]; then - date '+%s' > "${rootdir}/${lockselfname}" + if [[ "$(cat "${lockdir}/${selfname}.lock")" =~ [A-Za-z] ]]; then + date '+%s' > "${lockdir}/${selfname}.lock" fi } @@ -108,7 +108,7 @@ for queryattempt in {1..5}; do fn_script_log_info "Querying port: ${querymethod}: ${ip}:${queryport} : ${queryattempt} : QUERYING" fn_sleep_time # querydelay - if [ "$(cat "${rootdir}/${lockselfname}")" -gt "$(date "+%s" -d "${querydelay} mins ago")" ]; then + if [ "$(cat "${lockdir}/${selfname}.lock")" -gt "$(date "+%s" -d "${querydelay} mins ago")" ]; then fn_print_ok "Querying port: ${querymethod}: ${ip}:${queryport} : ${totalseconds}/${queryattempt}: " fn_print_delay_eol_nl fn_script_log_info "Querying port: ${querymethod}: ${ip}:${queryport} : ${queryattempt} : DELAY" @@ -236,6 +236,7 @@ info_parms.sh # query pre-checks fn_monitor_check_lockfile +check_last_update.sh fn_monitor_check_update fn_monitor_check_session # Monitor will not continue if session only check. diff --git a/lgsm/functions/command_start.sh b/lgsm/functions/command_start.sh index bf5c65146..be230c26b 100644 --- a/lgsm/functions/command_start.sh +++ b/lgsm/functions/command_start.sh @@ -62,13 +62,16 @@ fn_start_tmux(){ fi # Create lockfile - date > "${rootdir}/${lockselfname}" + date > "${lockdir}/${selfname}.lock" cd "${executabledir}" || exit tmux new-session -d -x "${sessionwidth}" -y "${sessionheight}" -s "${selfname}" "${executable} ${parms}" 2> "${lgsmlogdir}/.${selfname}-tmux-error.tmp" # Create logfile. touch "${consolelog}" + # Create last start lock file + date +%s > "${lockdir}/${selfname}-laststart.lock" + # Get tmux version. tmuxversion=$(tmux -V | sed "s/tmux //" | sed -n '1 p') # Tmux compiled from source will return "master", therefore ignore it. diff --git a/lgsm/functions/command_stop.sh b/lgsm/functions/command_stop.sh index 98f41b487..fecd0fac5 100644 --- a/lgsm/functions/command_stop.sh +++ b/lgsm/functions/command_stop.sh @@ -241,8 +241,8 @@ fn_print_dots "${servername}" info_config.sh fn_stop_pre_check # Remove lockfile. -if [ -f "${rootdir}/${lockselfname}" ]; then - rm -f "${rootdir:?}/${lockselfname}" +if [ -f "${lockdir}/${selfname}.lock" ]; then + rm -f "${lockdir:?}/${selfname}.lock" fi if [ -z "${exitbypass}" ]; then diff --git a/lgsm/functions/command_update.sh b/lgsm/functions/command_update.sh index 64cfcb2f5..86a9a1cc4 100644 --- a/lgsm/functions/command_update.sh +++ b/lgsm/functions/command_update.sh @@ -11,6 +11,7 @@ local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") fn_print_dots "" check.sh logs.sh +check_last_update.sh if [ "${shortname}" == "ts3" ]; then update_ts3.sh diff --git a/lgsm/functions/core_functions.sh b/lgsm/functions/core_functions.sh index 54d7ec6a2..d1969c920 100644 --- a/lgsm/functions/core_functions.sh +++ b/lgsm/functions/core_functions.sh @@ -188,6 +188,11 @@ functionfile="${FUNCNAME[0]}" fn_fetch_function } +check_last_update.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + check_logs.sh(){ functionfile="${FUNCNAME[0]}" fn_fetch_function @@ -701,6 +706,11 @@ if [ ! -d "${tmpdir}" ]; then mkdir -p "${tmpdir}" fi +# Creates lock dir if missing +if [ ! -d "${lockdir}" ]; then + mkdir -p "${lockdir}" +fi + # Calls on-screen messages (bootstrap) core_messages.sh diff --git a/lgsm/functions/logs.sh b/lgsm/functions/logs.sh index dc55456ef..001391778 100644 --- a/lgsm/functions/logs.sh +++ b/lgsm/functions/logs.sh @@ -41,8 +41,7 @@ if [ "$(find "${lgsmlogdir}"/ -type f -mtime +"${logdays}" | wc -l)" -ne "0" ]; # Setting up counting variables scriptcount="0" ; consolecount="0" ; gamecount="0" ; srcdscount="0" ; smcount="0" ; ulxcount="0" ; darkrpcount="0" ; legacycount="0" fn_sleep_time - fn_print_ok_nl "Starting" - fn_print_info_nl "Removing logs older than ${logdays} days" + fn_print_info "Removing logs older than ${logdays} days" fn_script_log_info "Removing logs older than ${logdays} days" # Logging logfiles to be removed according to "${logdays}", counting and removing them. # Script logfiles. @@ -100,6 +99,6 @@ if [ "$(find "${lgsmlogdir}"/ -type f -mtime +"${logdays}" | wc -l)" -ne "0" ]; # Count total amount of files removed. countlogs=$((scriptcount + consolecount + gamecount + srcdscount + smcount + ulxcount + darkrpcount)) # Job done. - fn_print_ok_nl "Removed ${countlogs} log files" + fn_print_ok "Removed ${countlogs} log files" fn_script_log "Removed ${countlogs} log files" fi diff --git a/lgsm/functions/update_factorio.sh b/lgsm/functions/update_factorio.sh index c6a0383ab..b6700f66c 100644 --- a/lgsm/functions/update_factorio.sh +++ b/lgsm/functions/update_factorio.sh @@ -108,6 +108,7 @@ fn_update_factorio_compare(){ exitbypass=1 command_start.sh fi + date +%s > "${lockdir}/lastupdate.lock" alert="update" alert.sh else diff --git a/lgsm/functions/update_minecraft.sh b/lgsm/functions/update_minecraft.sh index f24d44df8..361867467 100644 --- a/lgsm/functions/update_minecraft.sh +++ b/lgsm/functions/update_minecraft.sh @@ -167,6 +167,7 @@ fn_update_minecraft_compare(){ exitbypass=1 command_start.sh fi + date +%s > "${lockdir}/lastupdate.lock" alert="update" alert.sh else diff --git a/lgsm/functions/update_minecraft_bedrock.sh b/lgsm/functions/update_minecraft_bedrock.sh index 57306f063..2cb29930f 100644 --- a/lgsm/functions/update_minecraft_bedrock.sh +++ b/lgsm/functions/update_minecraft_bedrock.sh @@ -133,6 +133,7 @@ fn_update_minecraft_compare(){ exitbypass=1 command_start.sh fi + date +%s > "${lockdir}/lastupdate.lock" alert="update" alert.sh else diff --git a/lgsm/functions/update_mta.sh b/lgsm/functions/update_mta.sh index 1b8e5304d..5c5824983 100644 --- a/lgsm/functions/update_mta.sh +++ b/lgsm/functions/update_mta.sh @@ -165,6 +165,7 @@ fn_update_mta_compare(){ exitbypass=1 command_start.sh fi + date +%s > "${lockdir}/lastupdate.lock" alert="update" alert.sh else diff --git a/lgsm/functions/update_mumble.sh b/lgsm/functions/update_mumble.sh index 7bbfb134b..af320079d 100644 --- a/lgsm/functions/update_mumble.sh +++ b/lgsm/functions/update_mumble.sh @@ -101,6 +101,7 @@ fn_update_mumble_compare(){ exitbypass=1 command_start.sh fi + date +%s > "${lockdir}/lastupdate.lock" alert="update" alert.sh else diff --git a/lgsm/functions/update_steamcmd.sh b/lgsm/functions/update_steamcmd.sh index 8e4918494..f2651b3de 100644 --- a/lgsm/functions/update_steamcmd.sh +++ b/lgsm/functions/update_steamcmd.sh @@ -108,6 +108,7 @@ fn_update_steamcmd_compare(){ echo -e "* Branch: ${branch}" fi echo -e "https://steamdb.info/app/${appid}/" + echo -en "\n" fn_script_log_info "Update available" fn_script_log_info "Local build: ${localbuild}" fn_script_log_info "Remote build: ${remotebuild}" @@ -128,9 +129,11 @@ fn_update_steamcmd_compare(){ command_stop.sh exitbypass=1 fn_update_steamcmd_dl + date +%s > "${lockdir}/lastupdate.lock" exitbypass=1 command_start.sh fi + alert="update" alert.sh else @@ -143,6 +146,7 @@ fn_update_steamcmd_compare(){ echo -e "* Branch: ${branch}" fi echo -e "https://steamdb.info/app/${appid}/" + echo -en "\n" fn_script_log_info "No update available" fn_script_log_info "Local build: ${localbuild}" fn_script_log_info "Remote build: ${remotebuild}" @@ -219,6 +223,7 @@ fn_stop_warning(){ # The location where the builds are checked and downloaded. remotelocation="SteamCMD" check.sh + if [ "${forceupdate}" == "1" ]; then # forceupdate bypasses update checks. check_status.sh @@ -227,10 +232,12 @@ if [ "${forceupdate}" == "1" ]; then exitbypass=1 command_stop.sh fn_update_steamcmd_dl + date +%s > "${lockdir}/lastupdate.lock" exitbypass=1 command_start.sh else fn_update_steamcmd_dl + date +%s > "${lockdir}/lastupdate.lock" fi else fn_print_dots "Checking for update" diff --git a/linuxgsm.sh b/linuxgsm.sh index 9e5a5b685..eb9368997 100755 --- a/linuxgsm.sh +++ b/linuxgsm.sh @@ -1,7 +1,7 @@ #!/bin/bash # Project: Game Server Managers - LinuxGSM # Author: Daniel Gibbs -# License: MIT License, Copyright (c) 2019 Daniel Gibbs +# License: MIT License, Copyright (c) 2020 Daniel Gibbs # Purpose: Linux Game Server Management Script # Contributors: https://linuxgsm.com/contrib # Documentation: https://docs.linuxgsm.com @@ -25,7 +25,6 @@ shortname="core" gameservername="core" rootdir=$(dirname "$(readlink -f "${BASH_SOURCE[0]}")") selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") -lockselfname=".${selfname}.lock" lgsmdir="${rootdir}/lgsm" logdir="${rootdir}/log" lgsmlogdir="${logdir}/lgsm" @@ -34,6 +33,7 @@ serverfiles="${rootdir}/serverfiles" functionsdir="${lgsmdir}/functions" tmpdir="${lgsmdir}/tmp" datadir="${lgsmdir}/data" +lockdir="${lgsmdir}/lock" serverlist="${datadir}/serverlist.csv" serverlistmenu="${datadir}/serverlistmenu.csv" configdir="${lgsmdir}/config-lgsm" diff --git a/tests/tests_fctrserver.sh b/tests/tests_fctrserver.sh index 67008f883..8e80ee5f6 100644 --- a/tests/tests_fctrserver.sh +++ b/tests/tests_fctrserver.sh @@ -1,7 +1,7 @@ #!/bin/bash # Project: Game Server Managers - LinuxGSM # Author: Daniel Gibbs -# License: MIT License, Copyright (c) 2019 Daniel Gibbs +# License: MIT License, Copyright (c) 2020 Daniel Gibbs # Purpose: Travis CI Tests: Factorio | Linux Game Server Management Script # Contributors: https://linuxgsm.com/contrib # Documentation: https://docs.linuxgsm.com @@ -20,12 +20,11 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v19.9.0" +version="v20.1.5" shortname="fctr" gameservername="fctrserver" rootdir=$(dirname "$(readlink -f "${BASH_SOURCE[0]}")") selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") -lockselfname=".${selfname}.lock" lgsmdir="${rootdir}/lgsm" logdir="${rootdir}/log" lgsmlogdir="${logdir}/lgsm" @@ -34,6 +33,7 @@ serverfiles="${rootdir}/serverfiles" functionsdir="${lgsmdir}/functions" tmpdir="${lgsmdir}/tmp" datadir="${lgsmdir}/data" +lockdir="${lgsmdir}/lock" serverlist="${datadir}/serverlist.csv" serverlistmenu="${datadir}/serverlistmenu.csv" configdir="${lgsmdir}/config-lgsm" @@ -812,7 +812,7 @@ echo -e "Command: ./${gameservername} monitor" requiredstatus="OFFLINE" fn_setstatus fn_print_info_nl "creating lockfile." -date '+%s' > "${rootdir}/${lockselfname}" +date '+%s' > "${lockdir}/${selfname}.lock" ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" diff --git a/tests/tests_jc2server.sh b/tests/tests_jc2server.sh index 949509814..56fc47808 100644 --- a/tests/tests_jc2server.sh +++ b/tests/tests_jc2server.sh @@ -1,7 +1,7 @@ #!/bin/bash # Project: Game Server Managers - LinuxGSM # Author: Daniel Gibbs -# License: MIT License, Copyright (c) 2019 Daniel Gibbs +# License: MIT License, Copyright (c) 2020 Daniel Gibbs # Purpose: Travis CI Tests: Just Cause 2 | Linux Game Server Management Script # Contributors: https://linuxgsm.com/contrib # Documentation: https://docs.linuxgsm.com @@ -20,12 +20,11 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v19.9.0" +version="v20.1.5" shortname="jc2" gameservername="jc2server" rootdir=$(dirname "$(readlink -f "${BASH_SOURCE[0]}")") selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") -lockselfname=".${selfname}.lock" lgsmdir="${rootdir}/lgsm" logdir="${rootdir}/log" lgsmlogdir="${logdir}/lgsm" @@ -34,6 +33,7 @@ serverfiles="${rootdir}/serverfiles" functionsdir="${lgsmdir}/functions" tmpdir="${lgsmdir}/tmp" datadir="${lgsmdir}/data" +lockdir="${lgsmdir}/lock" serverlist="${datadir}/serverlist.csv" serverlistmenu="${datadir}/serverlistmenu.csv" configdir="${lgsmdir}/config-lgsm" @@ -966,7 +966,7 @@ echo -e "Command: ./${gameservername} monitor" requiredstatus="OFFLINE" fn_setstatus fn_print_info_nl "creating lockfile." -date '+%s' > "${rootdir}/${lockselfname}" +date '+%s' > "${lockdir}/${selfname}.lock" ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" diff --git a/tests/tests_mcserver.sh b/tests/tests_mcserver.sh index 9e8bf266c..c34d26edf 100644 --- a/tests/tests_mcserver.sh +++ b/tests/tests_mcserver.sh @@ -1,7 +1,7 @@ #!/bin/bash # Project: Game Server Managers - LinuxGSM # Author: Daniel Gibbs -# License: MIT License, Copyright (c) 2019 Daniel Gibbs +# License: MIT License, Copyright (c) 2020 Daniel Gibbs # Purpose: Travis CI Tests: Minecraft | Linux Game Server Management Script # Contributors: https://linuxgsm.com/contrib # Documentation: https://docs.linuxgsm.com @@ -20,12 +20,11 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v19.9.0" +version="v20.1.5" shortname="mc" gameservername="mcserver" rootdir=$(dirname "$(readlink -f "${BASH_SOURCE[0]}")") selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") -lockselfname=".${selfname}.lock" lgsmdir="${rootdir}/lgsm" logdir="${rootdir}/log" lgsmlogdir="${logdir}/lgsm" @@ -34,6 +33,7 @@ serverfiles="${rootdir}/serverfiles" functionsdir="${lgsmdir}/functions" tmpdir="${lgsmdir}/tmp" datadir="${lgsmdir}/data" +lockdir="${lgsmdir}/lock" serverlist="${datadir}/serverlist.csv" serverlistmenu="${datadir}/serverlistmenu.csv" configdir="${lgsmdir}/config-lgsm" @@ -845,7 +845,7 @@ echo -e "Command: ./${gameservername} monitor" requiredstatus="OFFLINE" fn_setstatus fn_print_info_nl "creating lockfile." -date '+%s' > "${rootdir}/${lockselfname}" +date '+%s' > "${lockdir}/${selfname}.lock" ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" diff --git a/tests/tests_shellcheck.sh b/tests/tests_shellcheck.sh index 51784906c..f4bbf4868 100644 --- a/tests/tests_shellcheck.sh +++ b/tests/tests_shellcheck.sh @@ -1,7 +1,7 @@ #!/bin/bash # Project: Game Server Managers - LinuxGSM # Author: Daniel Gibbs -# License: MIT License, Copyright (c) 2019 Daniel Gibbs +# License: MIT License, Copyright (c) 2020 Daniel Gibbs # Purpose: Travis CI Tests: Shellcheck | Linux Game Server Management Script # Contributors: https://github.com/GameServerManagers/LinuxGSM/graphs/contributors # Documentation: https://docs.linuxgsm.com/ diff --git a/tests/tests_ts3server.sh b/tests/tests_ts3server.sh index a9527b68b..b51411a3b 100644 --- a/tests/tests_ts3server.sh +++ b/tests/tests_ts3server.sh @@ -1,7 +1,7 @@ #!/bin/bash # Project: Game Server Managers - LinuxGSM # Author: Daniel Gibbs -# License: MIT License, Copyright (c) 2019 Daniel Gibbs +# License: MIT License, Copyright (c) 2020 Daniel Gibbs # Purpose: Travis CI Tests: Teamspeak 3 | Linux Game Server Management Script # Contributors: https://linuxgsm.com/contrib # Documentation: https://docs.linuxgsm.com @@ -20,12 +20,11 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v19.9.0" +version="v20.1.5" shortname="ts3" gameservername="ts3server" rootdir=$(dirname "$(readlink -f "${BASH_SOURCE[0]}")") selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") -lockselfname=".${selfname}.lock" lgsmdir="${rootdir}/lgsm" logdir="${rootdir}/log" lgsmlogdir="${logdir}/lgsm" @@ -34,6 +33,7 @@ serverfiles="${rootdir}/serverfiles" functionsdir="${lgsmdir}/functions" tmpdir="${lgsmdir}/tmp" datadir="${lgsmdir}/data" +lockdir="${lgsmdir}/lock" serverlist="${datadir}/serverlist.csv" serverlistmenu="${datadir}/serverlistmenu.csv" configdir="${lgsmdir}/config-lgsm" @@ -812,7 +812,7 @@ echo -e "Command: ./${gameservername} monitor" requiredstatus="OFFLINE" fn_setstatus fn_print_info_nl "creating lockfile." -date '+%s' > "${rootdir}/${lockselfname}" +date '+%s' > "${lockdir}/${selfname}.lock" ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5"