From fc0e3eca05cf28fd92e551631270a47f530421c4 Mon Sep 17 00:00:00 2001 From: unknowntrojan <14975032+unknowntrojan@users.noreply.github.com> Date: Sat, 19 Dec 2020 16:22:33 +0100 Subject: [PATCH] Fix Stop Command when console has pending input Properly execute quit when the session was improperly detached with something typed on the command line. For example, someone types a command into the server console, then detaches. The stop command will wait, fail and need manual intervention. This should fix that. --- lgsm/functions/command_stop.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/functions/command_stop.sh b/lgsm/functions/command_stop.sh index 439967fd0..6fe06e4ef 100644 --- a/lgsm/functions/command_stop.sh +++ b/lgsm/functions/command_stop.sh @@ -43,7 +43,7 @@ fn_stop_graceful_cmd(){ fn_print_dots "Graceful: sending \"${1}\"" fn_script_log_info "Graceful: sending \"${1}\"" # Sends specific stop command. - tmux send -t "${sessionname}" "${1}" ENTER > /dev/null 2>&1 + tmux send -t "${sessionname}" ENTER "${1}" ENTER > /dev/null 2>&1 # Waits up to ${seconds} seconds giving the server time to shutdown gracefully. for ((seconds=1; seconds<=${2}; seconds++)); do check_status.sh