Spam C-c on kill_server
This commit is contained in:
parent
ead238fd60
commit
fb66cdc826
@ -381,16 +381,16 @@ kill_server() {
|
|||||||
local attempts
|
local attempts
|
||||||
local max_attempts
|
local max_attempts
|
||||||
attempts=0
|
attempts=0
|
||||||
max_attempts=3
|
max_attempts=5
|
||||||
while tmux has-session -t "${session}" >/dev/null 2>&1; do
|
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}"
|
log "error" "Unable to kill session ${session}"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
log "info" "Attempting to gracefully kill $(important "${session}")"
|
log "info" "Attempting to gracefully kill $(important "${session}")"
|
||||||
tmux send-keys -t "${session}" C-c
|
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 10 seconds..."
|
log "info" "Sent Exit Request, waiting 5 seconds..."
|
||||||
sleep 10
|
sleep 5
|
||||||
tmux send-keys -t "${session}" C-d
|
tmux send-keys -t "${session}" C-d
|
||||||
done
|
done
|
||||||
log "info" "Successfully stopped $(important "${session}")"
|
log "info" "Successfully stopped $(important "${session}")"
|
||||||
|
Loading…
Reference in New Issue
Block a user