mirror of
https://github.com/msmhq/msm.git
synced 2024-08-30 18:12:35 +00:00
Fixed two bugs in the interrupt handler.
It would always find the stop and restart counters for a server to be running, and then always print out the server name of used in the command, even if it was another server being stopped prematurely.
This commit is contained in:
parent
856eedfade
commit
828f108be1
9
msm
9
msm
@ -1356,21 +1356,22 @@ init() {
|
||||
interrupt() {
|
||||
local exit_message="false"
|
||||
for ((i=0; $i<$num_servers; i++)); do
|
||||
if [[ "${STOP_COUNTDOWN[$i]}" ]] && server_is_running $i; then
|
||||
if [[ "${STOP_COUNTDOWN[$i]}" == "true" ]] && server_is_running $i; then
|
||||
if [[ "$exit_message" == "false" ]]; then
|
||||
echo -e "\nInterrupted..."
|
||||
exit_message="true"
|
||||
fi
|
||||
server_eval $i "say ${server_stop_abort[$i]}"
|
||||
echo "Server \"${server_name[$id]}\" shutdown was aborted."
|
||||
echo "Server \"${server_name[$i]}\" shutdown was aborted."
|
||||
fi
|
||||
if [[ "${RESTART_COUNTDOWN[$i]}" ]] && server_is_running $i; then
|
||||
|
||||
if [[ "${RESTART_COUNTDOWN[$i]}" == "true" ]] && server_is_running $i; then
|
||||
if [[ "$exit_message" == "false" ]]; then
|
||||
echo -e "\nInterrupted..."
|
||||
exit_message="true"
|
||||
fi
|
||||
server_eval $i "say ${server_restart_abort[$i]}"
|
||||
echo "Server \"${server_name[$id]}\" restart was aborted."
|
||||
echo "Server \"${server_name[$i]}\" restart was aborted."
|
||||
fi
|
||||
done
|
||||
exit
|
||||
|
Loading…
Reference in New Issue
Block a user