From d04fd54ea5c35ce26f473b70868e4f6a6f706b8e Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Thu, 7 Jul 2016 21:44:00 +0100 Subject: [PATCH] console will attempt access after starting --- lgsm/functions/command_console.sh | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/lgsm/functions/command_console.sh b/lgsm/functions/command_console.sh index bb53c20d1..67096e9fc 100644 --- a/lgsm/functions/command_console.sh +++ b/lgsm/functions/command_console.sh @@ -9,6 +9,13 @@ lgsm_version="210516" local modulename="Console" function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +fn_console_access(){ + fn_print_ok_nl "Starting" + fn_script_log_info "Accessed" + sleep 1 + tmux attach-session -t ${servicename} +} + check.sh echo "" echo "${gamename} Console" @@ -29,10 +36,7 @@ fn_print_dots "Starting" sleep 1 check_status.sh if [ "${status}" != "0" ]; then - fn_print_ok_nl "Starting" - fn_script_log_info "Accessed" - sleep 1 - tmux attach-session -t ${servicename} + fn_console_access else fn_print_fail_nl "Server not running" fn_script_log_error "Failed to access: Server not running" @@ -40,10 +44,11 @@ else while true; do read -p "Do you want to start the server? [y/N]" yn case $yn in - [Yy]* ) command_start.sh; break;; + [Yy]* ) exitbypass=1; command_start.sh; break;; [Nn]* ) break;; * ) echo "Please answer yes or no.";; esac done + fn_console_access fi core_exit.sh