diff --git a/lgsm/functions/alert.sh b/lgsm/functions/alert.sh index 916f80e67..5fd999728 100755 --- a/lgsm/functions/alert.sh +++ b/lgsm/functions/alert.sh @@ -7,6 +7,8 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +# Generates alert log of the details at the time of the alert. +# Used with email alerts. fn_alert_log(){ info_distro.sh info_config.sh diff --git a/lgsm/functions/command_debug.sh b/lgsm/functions/command_debug.sh index 07871ce00..7925e3ff9 100755 --- a/lgsm/functions/command_debug.sh +++ b/lgsm/functions/command_debug.sh @@ -29,7 +29,6 @@ fix.sh info_distro.sh info_config.sh # NOTE: Check if works with server without parms. Could be intergrated in to info_parms.sh. -fn_parms fn_print_header { echo -e "${lightblue}Distro:\t\t${default}${distroname}" @@ -70,11 +69,11 @@ if [ "${serverpassword}" ]; then fi echo -e "${lightblue}Start parameters:${default}" if [ "${engine}" == "source" ]||[ "${engine}" == "goldsrc" ]; then - echo -e "${executable} ${parms} -debug" + echo -e "${executable} ${startparameters} -debug" elif [ "${engine}" == "quake" ]; then - echo -e "${executable} ${parms} -condebug" + echo -e "${executable} ${startparameters} -condebug" else - echo -e "${preexecutable} ${executable} ${parms}" + echo -e "${preexecutable} ${executable} ${startparameters}" fi echo -e "" echo -e "Use for identifying server issues only!" @@ -104,19 +103,19 @@ fn_script_log_info "Lockfile generated" fn_script_log_info "${lockdir}/${selfname}.lock" cd "${executabledir}" || exit -# Note: do not add double quotes to ${executable} ${parms}. +# Note: do not add double quotes to ${executable} ${startparameters}. if [ "${engine}" == "source" ]||[ "${engine}" == "goldsrc" ]; then - ${executable} ${parms} -debug + ${executable} ${startparameters} -debug elif [ "${shortname}" == "arma3" ]; then # Arma3 requires semicolons in the module list, which need to # be escaped for regular (tmux) loading, but need to be # stripped when loading straight from the console. ${executable} ${parms//\\;/;} elif [ "${engine}" == "quake" ]; then - ${executable} ${parms} -condebug + ${executable} ${startparameters} -condebug else # shellcheck disable=SC2086 - ${preexecutable} ${executable} ${parms} + ${preexecutable} ${executable} ${startparameters} fi fn_lockfile_trap diff --git a/lgsm/functions/command_details.sh b/lgsm/functions/command_details.sh index 8f2a03a98..14765ca99 100755 --- a/lgsm/functions/command_details.sh +++ b/lgsm/functions/command_details.sh @@ -32,7 +32,6 @@ fn_info_message_script fn_info_message_backup # Some game servers do not have parms. if [ "${shortname}" != "ts3" ]&&[ "${shortname}" != "jc2" ]&&[ "${shortname}" != "dst" ]&&[ "${shortname}" != "pz" ]&&[ "${engine}" != "renderware" ]; then - fn_parms fn_info_message_commandlineparms fi fn_info_message_ports diff --git a/lgsm/functions/command_postdetails.sh b/lgsm/functions/command_postdetails.sh index 811938380..fa2907b1e 100755 --- a/lgsm/functions/command_postdetails.sh +++ b/lgsm/functions/command_postdetails.sh @@ -52,7 +52,6 @@ else fn_info_message_backup # Some game servers do not have parms. if [ "${shortname}" != "jc2" ]&&[ "${shortname}" != "jc3" ]&&[ "${shortname}" != "dst" ]&&[ "${shortname}" != "pz" ]&&[ "${engine}" != "renderware" ]; then - fn_parms fn_info_message_commandlineparms fi fn_info_message_ports diff --git a/lgsm/functions/command_start.sh b/lgsm/functions/command_start.sh index 998749a59..7dc4c962e 100755 --- a/lgsm/functions/command_start.sh +++ b/lgsm/functions/command_start.sh @@ -41,9 +41,7 @@ fn_start_jk2(){ fn_start_tmux(){ if [ "${parmsbypass}" ]; then - parms="" - else - fn_parms + startparameters="" fi # check for tmux size variables. if [[ "${servercfgtmuxwidth}" =~ ^[0-9]+$ ]]; then @@ -74,7 +72,7 @@ fn_start_tmux(){ echo "${version}" >> "${lockdir}/${selfname}.lock" echo "${port}" >> "${lockdir}/${selfname}.lock" cd "${executabledir}" || exit - tmux new-session -d -x "${sessionwidth}" -y "${sessionheight}" -s "${sessionname}" "${preexecutable} ${executable} ${parms}" 2> "${lgsmlogdir}/.${selfname}-tmux-error.tmp" + tmux new-session -d -x "${sessionwidth}" -y "${sessionheight}" -s "${sessionname}" "${preexecutable} ${executable} ${startparameters}" 2> "${lgsmlogdir}/.${selfname}-tmux-error.tmp" # Create logfile. touch "${consolelog}" @@ -128,7 +126,7 @@ fn_start_tmux(){ echo -e "" echo -e "Command" echo -e "=================================" - echo -e "tmux new-session -d -s \"${sessionname}\" \"${preexecutable} ${executable} ${parms}\"" | tee -a "${lgsmlog}" + echo -e "tmux new-session -d -s \"${sessionname}\" \"${preexecutable} ${executable} ${startparameters}\"" | tee -a "${lgsmlog}" echo -e "" echo -e "Error" echo -e "=================================" diff --git a/lgsm/functions/fix_av.sh b/lgsm/functions/fix_av.sh index 6aed64f5e..f34a01c37 100755 --- a/lgsm/functions/fix_av.sh +++ b/lgsm/functions/fix_av.sh @@ -10,14 +10,10 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}:${serverfiles}/linux64" if [ "${postinstall}" == "1" ]; then - fn_parms(){ - parms="--datapath ${avdatapath} --galaxy-name ${selfname} --init-folders-only" - } - + startparameters="--datapath ${avdatapath} --galaxy-name ${selfname} --init-folders-only" fn_print_information "starting ${gamename} server to generate configs." fn_sleep_time # go to the executeable dir and start the init of the server cd "${systemdir}" || return 2 - fn_parms - "${executabledir}/${executable}" ${parms} + "${executabledir}/${executable}" ${startparameters} fi diff --git a/lgsm/functions/fix_kf2.sh b/lgsm/functions/fix_kf2.sh index d9f8c82b4..b680a9937 100755 --- a/lgsm/functions/fix_kf2.sh +++ b/lgsm/functions/fix_kf2.sh @@ -7,9 +7,7 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -fn_parms(){ -parms="\"${defaultmap}?Game=KFGameContent.KFGameInfo_VersusSurvival\"" -} +startparameters="\"${defaultmap}?Game=KFGameContent.KFGameInfo_VersusSurvival\"" fn_print_information "starting ${gamename} server to generate configs." fn_sleep_time diff --git a/lgsm/functions/fix_ut3.sh b/lgsm/functions/fix_ut3.sh index d3b6f824b..6bd26a53a 100755 --- a/lgsm/functions/fix_ut3.sh +++ b/lgsm/functions/fix_ut3.sh @@ -7,9 +7,7 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -fn_parms(){ -parms="server VCTF-Suspense?Game=UTGameContent.UTVehicleCTFGame_Content?bIsDedicated=true?bIsLanMatch=false?bUsesStats=false?bShouldAdvertise=false?PureServer=1?bAllowJoinInProgress=true?ConfigSubDir=${selfname} -port=${port} -queryport=${queryport} -multihome=${ip} -nohomedir -unattended -log=${gamelog}" -} +startparameters="server VCTF-Suspense?Game=UTGameContent.UTVehicleCTFGame_Content?bIsDedicated=true?bIsLanMatch=false?bUsesStats=false?bShouldAdvertise=false?PureServer=1?bAllowJoinInProgress=true?ConfigSubDir=${selfname} -port=${port} -queryport=${queryport} -multihome=${ip} -nohomedir -unattended -log=${gamelog}" fn_print_information "starting ${gamename} server to generate configs." fn_sleep_time diff --git a/lgsm/functions/info_distro.sh b/lgsm/functions/info_distro.sh index 7e0e6534d..697ee007d 100755 --- a/lgsm/functions/info_distro.sh +++ b/lgsm/functions/info_distro.sh @@ -74,6 +74,9 @@ if [ "${status}" == "1" ]&&[ "${tmuxv}" != "1.8" ]; then gameserverpid=$(tmux list-sessions -F "#{session_name} #{pane_pid}" | grep "^${sessionname} " | awk '{print $NF}') fi +## Date +date="$(date)" + ## Uptime uptime=$( Game/Query\tOUTBOUND\t${port}\tudp" + echo -e "> Game/Query\tINBOUND\t${port}\tudp" echo -e "> HTTP Server\tINBOUND\t${httpport}\ttcp" if [ "${ase}" == "Enabled" ]; then echo -e "> Query Port\tOUTBOUND\t${queryport}\tudp" @@ -1642,50 +1698,3 @@ fn_info_message_select_engine(){ fn_print_error_nl "Unable to detect server engine." fi } - -# Separator is different for details -fn_messages_separator(){ - if [ "${commandname}" == "details" ]; then - printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = - else - echo -e "=================================" - fi -} - -# Removes the passwords form all but details -fn_info_message_password_strip(){ - if [ "${commandname}" != "DETAILS" ]; then - if [ "${serverpassword}" ]; then - serverpassword="********" - fi - - if [ "${rconpassword}" ]; then - rconpassword="********" - fi - - if [ "${adminpassword}" ]; then - adminpassword="********" - fi - - if [ "${statspassword}" ]; then - statspassword="********" - fi - - if [ "${webadminpass}" ]; then - webadminpass="********" - fi - - if [ "${telnetpass}" ]; then - telnetpass="********" - fi - - if [ "${wsapikey}" ]; then - wsapikey="********" - fi - - if [ "${gslt}" ]; then - gslt="********" - fi - - fi -} diff --git a/tests/tests_fctrserver.sh b/tests/tests_fctrserver.sh index a2099236b..b72e2b025 100644 --- a/tests/tests_fctrserver.sh +++ b/tests/tests_fctrserver.sh @@ -466,9 +466,9 @@ fi fn_currentstatus_tmux(){ check_status.sh if [ "${status}" != "0" ]; then - currentstatus="ONLINE" + currentstatus="STARTED" else - currentstatus="OFFLINE" + currentstatus="STOPPED" fi } @@ -483,7 +483,7 @@ fn_setstatus(){ fn_currentstatus_tmux echo -en "New status: ${currentstatus}\\r" - if [ "${requiredstatus}" == "ONLINE" ]; then + if [ "${requiredstatus}" == "STARTED" ]; then (command_start.sh > /dev/null 2>&1) else (command_stop.sh > /dev/null 2>&1) @@ -749,7 +749,7 @@ echo -e "=================================" echo -e "Description:" echo -e "start ${gamename} server." echo -e "Command: ./${gameservername} start" -requiredstatus="OFFLINE" +requiredstatus="STOPPED" fn_setstatus ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" @@ -768,7 +768,7 @@ echo -e "=================================" echo -e "Description:" echo -e "start ${gamename} server while already running." echo -e "Command: ./${gameservername} start" -requiredstatus="ONLINE" +requiredstatus="STARTED" fn_setstatus ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" @@ -787,7 +787,7 @@ echo -e "=================================" echo -e "Description:" echo -e "will update server on start." echo -e "Command: ./${gameservername} start" -requiredstatus="OFFLINE" +requiredstatus="STOPPED" fn_setstatus ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" @@ -806,7 +806,7 @@ echo -e "=================================" echo -e "Description:" echo -e "stop ${gamename} server." echo -e "Command: ./${gameservername} stop" -requiredstatus="ONLINE" +requiredstatus="STARTED" fn_setstatus ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" @@ -825,7 +825,7 @@ echo -e "=================================" echo -e "Description:" echo -e "stop ${gamename} server while already stopped." echo -e "Command: ./${gameservername} stop" -requiredstatus="OFFLINE" +requiredstatus="STOPPED" fn_setstatus ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" @@ -844,7 +844,7 @@ echo -e "=================================" echo -e "Description:" echo -e "restart ${gamename}." echo -e "Command: ./${gameservername} restart" -requiredstatus="ONLINE" +requiredstatus="STARTED" fn_setstatus ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" @@ -863,7 +863,7 @@ echo -e "=================================" echo -e "Description:" echo -e "restart ${gamename} while already stopped." echo -e "Command: ./${gameservername} restart" -requiredstatus="OFFLINE" +requiredstatus="STOPPED" fn_setstatus ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" @@ -886,7 +886,7 @@ echo -e "=================================" echo -e "Description:" echo -e "check for updates." echo -e "Command: ./${gameservername} update" -requiredstatus="OFFLINE" +requiredstatus="STOPPED" fn_setstatus ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" @@ -906,7 +906,7 @@ echo -e "Description:" echo -e "update LinuxGSM." echo -e "" echo -e "Command: ./jc2server update-lgam" -requiredstatus="ONLINE" +requiredstatus="STARTED" fn_setstatus ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" @@ -933,7 +933,7 @@ echo -e "=================================" echo -e "Description:" echo -e "run monitor server while already running." echo -e "Command: ./${gameservername} monitor" -requiredstatus="ONLINE" +requiredstatus="STARTED" fn_setstatus ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" @@ -952,7 +952,7 @@ echo -e "=================================" echo -e "Description:" echo -e "run monitor while server is offline with lockfile." echo -e "Command: ./${gameservername} monitor" -requiredstatus="OFFLINE" +requiredstatus="STOPPED" fn_setstatus fn_print_info_nl "creating lockfile." date '+%s' > "${lockdir}/${selfname}.lock" @@ -975,7 +975,7 @@ echo -e "=================================" echo -e "Description:" echo -e "run monitor while server is offline with no lockfile." echo -e "Command: ./${gameservername} monitor" -requiredstatus="OFFLINE" +requiredstatus="STOPPED" fn_setstatus ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" @@ -994,7 +994,7 @@ echo -e "=================================" echo -e "Description:" echo -e "run monitor while server is offline with no lockfile." echo -e "Command: ./${gameservername} test-alert" -requiredstatus="OFFLINE" +requiredstatus="STOPPED" fn_setstatus ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" @@ -1017,7 +1017,7 @@ echo -e "=================================" echo -e "Description:" echo -e "display details." echo -e "Command: ./${gameservername} details" -requiredstatus="ONLINE" +requiredstatus="STARTED" fn_setstatus ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" @@ -1036,7 +1036,7 @@ echo -e "=================================" echo -e "Description:" echo -e "post details." echo -e "Command: ./${gameservername} postdetails" -requiredstatus="ONLINE" +requiredstatus="STARTED" fn_setstatus ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" @@ -1059,7 +1059,7 @@ echo -e "=================================" echo -e "Description:" echo -e "run a backup." echo -e "Command: ./${gameservername} backup" -requiredstatus="ONLINE" +requiredstatus="STARTED" fn_setstatus echo -e "test de-activated until issue #1839 fixed" #(command_backup.sh) @@ -1078,7 +1078,7 @@ echo -e "=================================" echo -e "Description:" echo -e "detect glibc." echo -e "Command: ./${gameservername} detect-glibc" -requiredstatus="ONLINE" +requiredstatus="STARTED" fn_setstatus ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" @@ -1097,7 +1097,7 @@ echo -e "=================================" echo -e "Description:" echo -e "detect ldd." echo -e "Command: ./${gameservername} detect-ldd" -requiredstatus="ONLINE" +requiredstatus="STARTED" fn_setstatus ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" @@ -1116,7 +1116,7 @@ echo -e "=================================" echo -e "Description:" echo -e "detect dependencies." echo -e "Command: ./${gameservername} detect-deps" -requiredstatus="ONLINE" +requiredstatus="STARTED" fn_setstatus ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" @@ -1135,7 +1135,7 @@ echo -e "=================================" echo -e "Description:" echo -e "raw query output." echo -e "Command: ./${gameservername} query-raw" -requiredstatus="ONLINE" +requiredstatus="STARTED" fn_setstatus ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" @@ -1159,7 +1159,7 @@ echo -e "=================================" echo -e "Description:" echo -e "donate." echo -e "Command: ./${gameservername} donate" -requiredstatus="ONLINE" +requiredstatus="STARTED" fn_setstatus ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" @@ -1177,7 +1177,7 @@ echo -e "=================================" echo -e "Server Tests - Complete!" echo -e "Using: ${gamename}" echo -e "=================================" -requiredstatus="OFFLINE" +requiredstatus="STOPPED" fn_setstatus core_exit.sh diff --git a/tests/tests_jc2server.sh b/tests/tests_jc2server.sh index f151dda65..3b1b081a7 100644 --- a/tests/tests_jc2server.sh +++ b/tests/tests_jc2server.sh @@ -467,9 +467,9 @@ fi fn_currentstatus_tmux(){ check_status.sh if [ "${status}" != "0" ]; then - currentstatus="ONLINE" + currentstatus="STARTED" else - currentstatus="OFFLINE" + currentstatus="STOPPED" fi } @@ -484,7 +484,7 @@ fn_setstatus(){ fn_currentstatus_tmux echo -en "New status: ${currentstatus}\\r" - if [ "${requiredstatus}" == "ONLINE" ]; then + if [ "${requiredstatus}" == "STARTED" ]; then (command_start.sh > /dev/null 2>&1) else (command_stop.sh > /dev/null 2>&1) @@ -754,7 +754,7 @@ echo -e "=================================" echo -e "Description:" echo -e "start ${gamename} server." echo -e "Command: ./${gameservername} start" -requiredstatus="OFFLINE" +requiredstatus="STOPPED" fn_setstatus ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" @@ -773,7 +773,7 @@ echo -e "=================================" echo -e "Description:" echo -e "start ${gamename} server while already running." echo -e "Command: ./${gameservername} start" -requiredstatus="ONLINE" +requiredstatus="STARTED" fn_setstatus ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" @@ -792,7 +792,7 @@ echo -e "=================================" echo -e "Description:" echo -e "will update server on start." echo -e "Command: ./${gameservername} start" -requiredstatus="OFFLINE" +requiredstatus="STOPPED" fn_setstatus ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" @@ -811,7 +811,7 @@ echo -e "=================================" echo -e "Description:" echo -e "stop ${gamename} server." echo -e "Command: ./${gameservername} stop" -requiredstatus="ONLINE" +requiredstatus="STARTED" fn_setstatus ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" @@ -830,7 +830,7 @@ echo -e "=================================" echo -e "Description:" echo -e "stop ${gamename} server while already stopped." echo -e "Command: ./${gameservername} stop" -requiredstatus="OFFLINE" +requiredstatus="STOPPED" fn_setstatus ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" @@ -849,7 +849,7 @@ echo -e "=================================" echo -e "Description:" echo -e "restart ${gamename}." echo -e "Command: ./${gameservername} restart" -requiredstatus="ONLINE" +requiredstatus="STARTED" fn_setstatus ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" @@ -868,7 +868,7 @@ echo -e "=================================" echo -e "Description:" echo -e "restart ${gamename} while already stopped." echo -e "Command: ./${gameservername} restart" -requiredstatus="OFFLINE" +requiredstatus="STOPPED" fn_setstatus ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" @@ -891,7 +891,7 @@ echo -e "=================================" echo -e "Description:" echo -e "check for updates." echo -e "Command: ./${gameservername} update" -requiredstatus="OFFLINE" +requiredstatus="STOPPED" fn_setstatus ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" @@ -910,7 +910,7 @@ echo -e "=================================" echo -e "Description:" echo -e "change the buildid tricking SteamCMD to update." echo -e "Command: ./jc2server update" -requiredstatus="OFFLINE" +requiredstatus="STOPPED" fn_setstatus fn_print_info_nl "changed buildid to 0." sed -i 's/[0-9]\+/0/' "${serverfiles}/steamapps/appmanifest_${appid}.acf" @@ -931,7 +931,7 @@ echo -e "=================================" echo -e "Description:" echo -e "change the buildid tricking SteamCMD to update server while already running." echo -e "Command: ./jc2server update" -requiredstatus="ONLINE" +requiredstatus="STARTED" fn_setstatus fn_print_info_nl "changed buildid to 0." sed -i 's/[0-9]\+/0/' "${serverfiles}/steamapps/appmanifest_${appid}.acf" @@ -952,7 +952,7 @@ echo -e "=================================" echo -e "Description:" echo -e "removing appmanifest file will cause script to repair." echo -e "Command: ./jc2server update" -requiredstatus="OFFLINE" +requiredstatus="STOPPED" fn_setstatus fn_print_info_nl "removed appmanifest_${appid}.acf." rm --verbose "${serverfiles:?}/steamapps/appmanifest_${appid}.acf" @@ -973,7 +973,7 @@ echo -e "=================================" echo -e "Description:" echo -e "force-update bypassing update check." echo -e "Command: ./jc2server force-update" -requiredstatus="OFFLINE" +requiredstatus="STOPPED" fn_setstatus ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" @@ -992,7 +992,7 @@ echo -e "=================================" echo -e "Description:" echo -e "force-update bypassing update check server while already running." echo -e "Command: ./jc2server force-update" -requiredstatus="ONLINE" +requiredstatus="STARTED" fn_setstatus ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" @@ -1011,7 +1011,7 @@ echo -e "=================================" echo -e "Description:" echo -e "validate server files." echo -e "Command: ./jc2server validate" -requiredstatus="OFFLINE" +requiredstatus="STOPPED" fn_setstatus ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" @@ -1031,7 +1031,7 @@ echo -e "Description:" echo -e "validate server files while server already running." echo -e "" echo -e "Command: ./jc2server validate" -requiredstatus="ONLINE" +requiredstatus="STARTED" fn_setstatus ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" @@ -1051,7 +1051,7 @@ echo -e "Description:" echo -e "update LinuxGSM." echo -e "" echo -e "Command: ./jc2server update-lgam" -requiredstatus="ONLINE" +requiredstatus="STARTED" fn_setstatus ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" @@ -1092,7 +1092,7 @@ echo -e "=================================" echo -e "Description:" echo -e "run monitor server while already running." echo -e "Command: ./${gameservername} monitor" -requiredstatus="ONLINE" +requiredstatus="STARTED" fn_setstatus ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" @@ -1111,7 +1111,7 @@ echo -e "=================================" echo -e "Description:" echo -e "run monitor while server is offline with lockfile." echo -e "Command: ./${gameservername} monitor" -requiredstatus="OFFLINE" +requiredstatus="STOPPED" fn_setstatus fn_print_info_nl "creating lockfile." date '+%s' > "${lockdir}/${selfname}.lock" @@ -1134,7 +1134,7 @@ echo -e "=================================" echo -e "Description:" echo -e "run monitor while server is offline with no lockfile." echo -e "Command: ./${gameservername} monitor" -requiredstatus="OFFLINE" +requiredstatus="STOPPED" fn_setstatus ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" @@ -1153,7 +1153,7 @@ echo -e "=================================" echo -e "Description:" echo -e "run monitor while server is offline with no lockfile." echo -e "Command: ./${gameservername} test-alert" -requiredstatus="OFFLINE" +requiredstatus="STOPPED" fn_setstatus cp "${servercfgfullpath}" "config.lua" sed -i 's/[0-9]\+/0/' "${servercfgfullpath}" @@ -1183,7 +1183,7 @@ echo -e "=================================" echo -e "Description:" echo -e "display details." echo -e "Command: ./${gameservername} details" -requiredstatus="ONLINE" +requiredstatus="STARTED" fn_setstatus ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" @@ -1202,7 +1202,7 @@ echo -e "=================================" echo -e "Description:" echo -e "post details." echo -e "Command: ./${gameservername} postdetails" -requiredstatus="ONLINE" +requiredstatus="STARTED" fn_setstatus ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" @@ -1225,7 +1225,7 @@ echo -e "=================================" echo -e "Description:" echo -e "run a backup." echo -e "Command: ./${gameservername} backup" -requiredstatus="ONLINE" +requiredstatus="STARTED" fn_setstatus echo -e "test de-activated until issue #1839 fixed" #(command_backup.sh) @@ -1244,7 +1244,7 @@ echo -e "=================================" echo -e "Description:" echo -e "detect glibc." echo -e "Command: ./${gameservername} detect-glibc" -requiredstatus="ONLINE" +requiredstatus="STARTED" fn_setstatus ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" @@ -1263,7 +1263,7 @@ echo -e "=================================" echo -e "Description:" echo -e "detect ldd." echo -e "Command: ./${gameservername} detect-ldd" -requiredstatus="ONLINE" +requiredstatus="STARTED" fn_setstatus ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" @@ -1282,7 +1282,7 @@ echo -e "=================================" echo -e "Description:" echo -e "detect dependencies." echo -e "Command: ./${gameservername} detect-deps" -requiredstatus="ONLINE" +requiredstatus="STARTED" fn_setstatus ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" @@ -1301,7 +1301,7 @@ echo -e "=================================" echo -e "Description:" echo -e "raw query output." echo -e "Command: ./${gameservername} query-raw" -requiredstatus="ONLINE" +requiredstatus="STARTED" fn_setstatus ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" @@ -1324,7 +1324,7 @@ echo -e "=================================" echo -e "Description:" echo -e "donate." echo -e "Command: ./${gameservername} donate" -requiredstatus="ONLINE" +requiredstatus="STARTED" fn_setstatus ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" @@ -1342,6 +1342,6 @@ echo -e "=================================" echo -e "Server Tests - Complete!" echo -e "Using: ${gamename}" echo -e "=================================" -requiredstatus="OFFLINE" +requiredstatus="STOPPED" fn_setstatus core_exit.sh diff --git a/tests/tests_mcserver.sh b/tests/tests_mcserver.sh index 43b72c844..00fd32d17 100644 --- a/tests/tests_mcserver.sh +++ b/tests/tests_mcserver.sh @@ -467,9 +467,9 @@ fi fn_currentstatus_tmux(){ check_status.sh if [ "${status}" != "0" ]; then - currentstatus="ONLINE" + currentstatus="STARTED" else - currentstatus="OFFLINE" + currentstatus="STOPPED" fi } @@ -484,7 +484,7 @@ fn_setstatus(){ fn_currentstatus_tmux echo -en "New status: ${currentstatus}\\r" - if [ "${requiredstatus}" == "ONLINE" ]; then + if [ "${requiredstatus}" == "STARTED" ]; then (command_start.sh > /dev/null 2>&1) else (command_stop.sh > /dev/null 2>&1) @@ -748,7 +748,7 @@ echo -e "=================================" echo -e "Description:" echo -e "start ${gamename} server." echo -e "Command: ./${gameservername} start" -requiredstatus="OFFLINE" +requiredstatus="STOPPED" fn_setstatus ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" @@ -767,7 +767,7 @@ echo -e "=================================" echo -e "Description:" echo -e "start ${gamename} server while already running." echo -e "Command: ./${gameservername} start" -requiredstatus="ONLINE" +requiredstatus="STARTED" fn_setstatus ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" @@ -786,7 +786,7 @@ echo -e "=================================" echo -e "Description:" echo -e "will update server on start." echo -e "Command: ./${gameservername} start" -requiredstatus="OFFLINE" +requiredstatus="STOPPED" fn_setstatus ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" @@ -804,7 +804,7 @@ echo -e "=================================" echo -e "Description:" echo -e "give time for server to fully start." echo -e "Command: sleep 30" -requiredstatus="ONLINE" +requiredstatus="STARTED" fn_setstatus sleep 30 @@ -814,7 +814,7 @@ echo -e "=================================" echo -e "Description:" echo -e "stop ${gamename} server." echo -e "Command: ./${gameservername} stop" -requiredstatus="ONLINE" +requiredstatus="STARTED" fn_setstatus ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" @@ -833,7 +833,7 @@ echo -e "=================================" echo -e "Description:" echo -e "stop ${gamename} server while already stopped." echo -e "Command: ./${gameservername} stop" -requiredstatus="OFFLINE" +requiredstatus="STOPPED" fn_setstatus ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" @@ -852,7 +852,7 @@ echo -e "=================================" echo -e "Description:" echo -e "restart ${gamename}." echo -e "Command: ./${gameservername} restart" -requiredstatus="ONLINE" +requiredstatus="STARTED" fn_setstatus ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" @@ -871,7 +871,7 @@ echo -e "=================================" echo -e "Description:" echo -e "restart ${gamename} while already stopped." echo -e "Command: ./${gameservername} restart" -requiredstatus="OFFLINE" +requiredstatus="STOPPED" fn_setstatus ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" @@ -894,7 +894,7 @@ echo -e "=================================" echo -e "Description:" echo -e "check for updates." echo -e "Command: ./${gameservername} update" -requiredstatus="OFFLINE" +requiredstatus="STOPPED" fn_setstatus ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" @@ -914,7 +914,7 @@ echo -e "Description:" echo -e "update LinuxGSM." echo -e "" echo -e "Command: ./jc2server update-lgam" -requiredstatus="ONLINE" +requiredstatus="STARTED" fn_setstatus ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" @@ -955,7 +955,7 @@ echo -e "=================================" echo -e "Description:" echo -e "give time for server to fully start." echo -e "Command: sleep 30" -requiredstatus="ONLINE" +requiredstatus="STARTED" fn_setstatus sleep 30 @@ -965,7 +965,7 @@ echo -e "=================================" echo -e "Description:" echo -e "run monitor server while already running." echo -e "Command: ./${gameservername} monitor" -requiredstatus="ONLINE" +requiredstatus="STARTED" fn_setstatus ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" @@ -984,7 +984,7 @@ echo -e "=================================" echo -e "Description:" echo -e "run monitor while server is offline with lockfile." echo -e "Command: ./${gameservername} monitor" -requiredstatus="OFFLINE" +requiredstatus="STOPPED" fn_setstatus fn_print_info_nl "creating lockfile." date '+%s' > "${lockdir}/${selfname}.lock" @@ -1007,7 +1007,7 @@ echo -e "=================================" echo -e "Description:" echo -e "run monitor while server is offline with no lockfile." echo -e "Command: ./${gameservername} monitor" -requiredstatus="OFFLINE" +requiredstatus="STOPPED" fn_setstatus ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" @@ -1026,7 +1026,7 @@ echo -e "=================================" echo -e "Description:" echo -e "run monitor while server is offline with no lockfile." echo -e "Command: ./${gameservername} test-alert" -requiredstatus="OFFLINE" +requiredstatus="STOPPED" fn_setstatus ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" @@ -1049,7 +1049,7 @@ echo -e "=================================" echo -e "Description:" echo -e "display details." echo -e "Command: ./${gameservername} details" -requiredstatus="ONLINE" +requiredstatus="STARTED" fn_setstatus ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" @@ -1068,7 +1068,7 @@ echo -e "=================================" echo -e "Description:" echo -e "post details." echo -e "Command: ./${gameservername} postdetails" -requiredstatus="ONLINE" +requiredstatus="STARTED" fn_setstatus ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" @@ -1091,7 +1091,7 @@ echo -e "=================================" echo -e "Description:" echo -e "run a backup." echo -e "Command: ./${gameservername} backup" -requiredstatus="ONLINE" +requiredstatus="STARTED" fn_setstatus echo -e "test de-activated until issue #1839 fixed" #(command_backup.sh) @@ -1110,7 +1110,7 @@ echo -e "=================================" echo -e "Description:" echo -e "detect glibc." echo -e "Command: ./${gameservername} detect-glibc" -requiredstatus="ONLINE" +requiredstatus="STARTED" fn_setstatus ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" @@ -1129,7 +1129,7 @@ echo -e "=================================" echo -e "Description:" echo -e "detect ldd." echo -e "Command: ./${gameservername} detect-ldd" -requiredstatus="ONLINE" +requiredstatus="STARTED" fn_setstatus ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" @@ -1148,7 +1148,7 @@ echo -e "=================================" echo -e "Description:" echo -e "detect dependencies." echo -e "Command: ./${gameservername} detect-deps" -requiredstatus="ONLINE" +requiredstatus="STARTED" fn_setstatus ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" @@ -1181,7 +1181,7 @@ echo -e "=================================" echo -e "Description:" echo -e "raw query output." echo -e "Command: ./${gameservername} query-raw" -requiredstatus="ONLINE" +requiredstatus="STARTED" fn_setstatus ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" @@ -1204,7 +1204,7 @@ echo -e "=================================" echo -e "Description:" echo -e "donate." echo -e "Command: ./${gameservername} donate" -requiredstatus="ONLINE" +requiredstatus="STARTED" fn_setstatus ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" @@ -1222,7 +1222,7 @@ echo -e "=================================" echo -e "Server Tests - Complete!" echo -e "Using: ${gamename}" echo -e "=================================" -requiredstatus="OFFLINE" +requiredstatus="STOPPED" fn_setstatus core_exit.sh diff --git a/tests/tests_ts3server.sh b/tests/tests_ts3server.sh index e6f29d23d..0fcee304a 100644 --- a/tests/tests_ts3server.sh +++ b/tests/tests_ts3server.sh @@ -467,9 +467,9 @@ fi fn_currentstatus_tmux(){ check_status.sh if [ "${status}" != "0" ]; then - currentstatus="ONLINE" + currentstatus="STARTED" else - currentstatus="OFFLINE" + currentstatus="STOPPED" fi } @@ -484,7 +484,7 @@ fn_setstatus(){ fn_currentstatus_tmux echo -en "New status: ${currentstatus}\\r" - if [ "${requiredstatus}" == "ONLINE" ]; then + if [ "${requiredstatus}" == "STARTED" ]; then (command_start.sh > /dev/null 2>&1) else (command_stop.sh > /dev/null 2>&1) @@ -748,7 +748,7 @@ echo -e "=================================" echo -e "Description:" echo -e "start ${gamename} server." echo -e "Command: ./${gameservername} start" -requiredstatus="OFFLINE" +requiredstatus="STOPPED" fn_setstatus ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" @@ -767,7 +767,7 @@ echo -e "=================================" echo -e "Description:" echo -e "start ${gamename} server while already running." echo -e "Command: ./${gameservername} start" -requiredstatus="ONLINE" +requiredstatus="STARTED" fn_setstatus ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" @@ -786,7 +786,7 @@ echo -e "=================================" echo -e "Description:" echo -e "will update server on start." echo -e "Command: ./${gameservername} start" -requiredstatus="OFFLINE" +requiredstatus="STOPPED" fn_setstatus ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" @@ -805,7 +805,7 @@ echo -e "=================================" echo -e "Description:" echo -e "stop ${gamename} server." echo -e "Command: ./${gameservername} stop" -requiredstatus="ONLINE" +requiredstatus="STARTED" fn_setstatus ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" @@ -824,7 +824,7 @@ echo -e "=================================" echo -e "Description:" echo -e "stop ${gamename} server while already stopped." echo -e "Command: ./${gameservername} stop" -requiredstatus="OFFLINE" +requiredstatus="STOPPED" fn_setstatus ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" @@ -843,7 +843,7 @@ echo -e "=================================" echo -e "Description:" echo -e "restart ${gamename}." echo -e "Command: ./${gameservername} restart" -requiredstatus="ONLINE" +requiredstatus="STARTED" fn_setstatus ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" @@ -862,7 +862,7 @@ echo -e "=================================" echo -e "Description:" echo -e "restart ${gamename} while already stopped." echo -e "Command: ./${gameservername} restart" -requiredstatus="OFFLINE" +requiredstatus="STOPPED" fn_setstatus ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" @@ -885,7 +885,7 @@ echo -e "=================================" echo -e "Description:" echo -e "check for updates." echo -e "Command: ./${gameservername} update" -requiredstatus="OFFLINE" +requiredstatus="STOPPED" fn_setstatus ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" @@ -905,7 +905,7 @@ echo -e "Description:" echo -e "update LinuxGSM." echo -e "" echo -e "Command: ./jc2server update-lgam" -requiredstatus="ONLINE" +requiredstatus="STARTED" fn_setstatus ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" @@ -932,7 +932,7 @@ echo -e "=================================" echo -e "Description:" echo -e "run monitor server while already running." echo -e "Command: ./${gameservername} monitor" -requiredstatus="ONLINE" +requiredstatus="STARTED" fn_setstatus ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" @@ -951,7 +951,7 @@ echo -e "=================================" echo -e "Description:" echo -e "run monitor while server is offline with lockfile." echo -e "Command: ./${gameservername} monitor" -requiredstatus="OFFLINE" +requiredstatus="STOPPED" fn_setstatus fn_print_info_nl "creating lockfile." date '+%s' > "${lockdir}/${selfname}.lock" @@ -974,7 +974,7 @@ echo -e "=================================" echo -e "Description:" echo -e "run monitor while server is offline with no lockfile." echo -e "Command: ./${gameservername} monitor" -requiredstatus="OFFLINE" +requiredstatus="STOPPED" fn_setstatus ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" @@ -993,7 +993,7 @@ echo -e "=================================" echo -e "Description:" echo -e "run monitor while server is offline with no lockfile." echo -e "Command: ./${gameservername} test-alert" -requiredstatus="OFFLINE" +requiredstatus="STOPPED" fn_setstatus ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" @@ -1016,7 +1016,7 @@ echo -e "=================================" echo -e "Description:" echo -e "display details." echo -e "Command: ./${gameservername} details" -requiredstatus="ONLINE" +requiredstatus="STARTED" fn_setstatus ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" @@ -1035,7 +1035,7 @@ echo -e "=================================" echo -e "Description:" echo -e "post details." echo -e "Command: ./${gameservername} postdetails" -requiredstatus="ONLINE" +requiredstatus="STARTED" fn_setstatus ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" @@ -1058,7 +1058,7 @@ echo -e "=================================" echo -e "Description:" echo -e "run a backup." echo -e "Command: ./${gameservername} backup" -requiredstatus="ONLINE" +requiredstatus="STARTED" fn_setstatus echo -e "test de-activated until issue #1839 fixed" #(command_backup.sh) @@ -1077,7 +1077,7 @@ echo -e "=================================" echo -e "Description:" echo -e "detect glibc." echo -e "Command: ./${gameservername} detect-glibc" -requiredstatus="ONLINE" +requiredstatus="STARTED" fn_setstatus ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" @@ -1096,7 +1096,7 @@ echo -e "=================================" echo -e "Description:" echo -e "detect ldd." echo -e "Command: ./${gameservername} detect-ldd" -requiredstatus="ONLINE" +requiredstatus="STARTED" fn_setstatus ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" @@ -1115,7 +1115,7 @@ echo -e "=================================" echo -e "Description:" echo -e "detect dependencies." echo -e "Command: ./${gameservername} detect-deps" -requiredstatus="ONLINE" +requiredstatus="STARTED" fn_setstatus ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" @@ -1134,7 +1134,7 @@ echo -e "=================================" echo -e "Description:" echo -e "raw query output." echo -e "Command: ./${gameservername} query-raw" -requiredstatus="ONLINE" +requiredstatus="STARTED" fn_setstatus ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" @@ -1157,7 +1157,7 @@ echo -e "=================================" echo -e "Description:" echo -e "donate." echo -e "Command: ./${gameservername} donate" -requiredstatus="ONLINE" +requiredstatus="STARTED" fn_setstatus ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" @@ -1175,7 +1175,7 @@ echo -e "=================================" echo -e "Server Tests - Complete!" echo -e "Using: ${gamename}" echo -e "=================================" -requiredstatus="OFFLINE" +requiredstatus="STOPPED" fn_setstatus core_exit.sh