From 94822d97cce147c113aa295b9b68f08053a9f2ad Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Tue, 12 Jul 2016 16:16:25 +0100 Subject: [PATCH] added check for found log file missing build --- lgsm/functions/update_ts3.sh | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/lgsm/functions/update_ts3.sh b/lgsm/functions/update_ts3.sh index 3f8fb2161..a63a73128 100644 --- a/lgsm/functions/update_ts3.sh +++ b/lgsm/functions/update_ts3.sh @@ -22,9 +22,6 @@ fn_update_ts3_dl(){ fi } - - - fn_update_ts3_currentbuild(){ # Gets currentbuild info # Checks currentbuild info is available, if fails a server restart will be forced to generate logs. @@ -33,10 +30,10 @@ fn_update_ts3_currentbuild(){ sleep 1 fn_print_error_nl "Checking for update: teamspeak.com: No logs with server version found" fn_script_log_error "Checking for update: teamspeak.com: No logs with server version found" - sleep 2 + sleep 1 fn_print_info_nl "Checking for update: teamspeak.com: Forcing server restart" fn_script_log_info "Checking for update: teamspeak.com: Forcing server restart" - sleep 2 + sleep 1 exitbypass=1 command_stop.sh exitbypass=1 @@ -51,6 +48,23 @@ fn_update_ts3_currentbuild(){ fi currentbuild=$(cat $(find ./* -name 'ts3server*_0.log' 2> /dev/null | sort | egrep -E -v '${rootdir}/.ts3version' | tail -1) | egrep -o 'TeamSpeak 3 Server ((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}' | egrep -o '((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}') + if [ -z "${currentbuild}" ]; then + fn_print_error_nl "Checking for update: teamspeak.com: Current build version not found" + fn_script_log_error "Checking for update: teamspeak.com: Current build version not found" + sleep 1 + fn_print_info_nl "Checking for update: teamspeak.com: Forcing server restart" + fn_script_log_info "Checking for update: teamspeak.com: Forcing server restart" + exitbypass=1 + command_stop.sh + exitbypass=1 + command_start.sh + currentbuild=$(cat $(find ./* -name 'ts3server*_0.log' 2> /dev/null | sort | egrep -E -v '${rootdir}/.ts3version' | tail -1) | egrep -o 'TeamSpeak 3 Server ((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}' | egrep -o '((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}') + if [ -z "${currentbuild}" ]; then + fn_print_fail_nl "Checking for update: teamspeak.com: Current build version still not found" + fn_script_log_fatal "Checking for update: teamspeak.com: Current build version still not found" + core_exit.sh + fi + fi } fn_update_ts3_arch(){