From fb66cdc826e388d0584d41cfcd7f3edf1ae16132 Mon Sep 17 00:00:00 2001 From: Price Hiller Date: Sat, 1 Jan 2022 03:24:49 -0600 Subject: [PATCH] Spam C-c on kill_server --- Scripts/7D2D-Manage.bash | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Scripts/7D2D-Manage.bash b/Scripts/7D2D-Manage.bash index 448579d..5af4c27 100644 --- a/Scripts/7D2D-Manage.bash +++ b/Scripts/7D2D-Manage.bash @@ -381,16 +381,16 @@ kill_server() { local attempts local max_attempts attempts=0 - max_attempts=3 + max_attempts=5 while tmux has-session -t "${session}" >/dev/null 2>&1; do - if [[ "${attempts}" -eq "${max_attempts}" ]]; then + if [[ "${attempts}" -gt "${max_attempts}" ]]; then log "error" "Unable to kill session ${session}" return 1 fi log "info" "Attempting to gracefully kill $(important "${session}")" - tmux send-keys -t "${session}" C-c - log "info" "Sent Exit Request, waiting 10 seconds..." - sleep 10 + tmux send-keys -t "${session}" C-c C-c C-c C-c C-c C-c C-c C-c C-c + log "info" "Sent Exit Request, waiting 5 seconds..." + sleep 5 tmux send-keys -t "${session}" C-d done log "info" "Successfully stopped $(important "${session}")"