When graceful works, probably because of pipe-pane or for whatever reason, the tmux session dies. But fn_stop_tmux was ran anyways, which then caused a command like
tmux kill-session -t csgoserver
to affect the closest matching alternate, like csgoserver-2 tmux session.
With this change, we make sure to run the session kill only when required.
# Attempts graceful of 7 Days To Die using telnet.
# Attempts graceful of 7 Days To Die using telnet.
@ -174,7 +171,6 @@ fn_stop_graceful_sdtd(){
fn_script_log_warn "Graceful: telnet: expect not installed: FAIL"
fn_script_log_warn "Graceful: telnet: expect not installed: FAIL"
fi
fi
sleep 0.5
sleep 0.5
fn_stop_tmux
}
}
fn_stop_graceful_select(){
fn_stop_graceful_select(){
@ -195,8 +191,6 @@ fn_stop_graceful_select(){
fn_stop_graceful_ctrlc
fn_stop_graceful_ctrlc
elif["${engine}"=="source"]||["${engine}"=="quake"]||["${engine}"=="idtech2"]||["${engine}"=="idtech3"]||["${engine}"=="idtech3_ql"]||["${engine}"=="Just Cause 2"]||["${engine}"=="projectzomboid"]||["${shortname}"=="rw"];then
elif["${engine}"=="source"]||["${engine}"=="quake"]||["${engine}"=="idtech2"]||["${engine}"=="idtech3"]||["${engine}"=="idtech3_ql"]||["${engine}"=="Just Cause 2"]||["${engine}"=="projectzomboid"]||["${shortname}"=="rw"];then
fn_stop_graceful_cmd "quit"30
fn_stop_graceful_cmd "quit"30
else
fn_stop_tmux
fi
fi
}
}
@ -293,6 +287,11 @@ fn_stop_pre_check(){
else
else
fn_stop_graceful_select
fn_stop_graceful_select
fi
fi
# Check status again, a stop tmux session if needed