mirror of
https://github.com/GameServerManagers/LinuxGSM.git
synced 2025-01-09 04:27:35 +08:00
fix(monitor): migration code
This commit is contained in:
parent
fe610f3ec9
commit
16c4493d1d
@ -72,6 +72,15 @@ fn_alert_check_update() {
|
|||||||
alertbody="${gamename} update available: ${remotebuildversion}"
|
alertbody="${gamename} update available: ${remotebuildversion}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn_alert_update_restart() {
|
||||||
|
fn_script_log_info "Sending alert: Restarted"
|
||||||
|
alertsubject="Alert - ${selfname} - Restarted"
|
||||||
|
alertemoji="🎮"
|
||||||
|
alertsound="1"
|
||||||
|
alerturl="not enabled"
|
||||||
|
alertbody="${gamename} received update: ${remotebuildversion} and required restarting"
|
||||||
|
}
|
||||||
|
|
||||||
fn_alert_permissions() {
|
fn_alert_permissions() {
|
||||||
fn_script_log_info "Sending alert: Permissions error"
|
fn_script_log_info "Sending alert: Permissions error"
|
||||||
alertsubject="Alert - ${selfname}: Permissions error"
|
alertsubject="Alert - ${selfname}: Permissions error"
|
||||||
@ -102,6 +111,8 @@ elif [ "${alert}" == "update" ]; then
|
|||||||
fn_alert_update
|
fn_alert_update
|
||||||
elif [ "${alert}" == "check-update" ]; then
|
elif [ "${alert}" == "check-update" ]; then
|
||||||
fn_alert_check_update
|
fn_alert_check_update
|
||||||
|
elif [ "${alert}" == "update-restart" ]; then
|
||||||
|
fn_alert_update_restart
|
||||||
elif [ "${alert}" == "config" ]; then
|
elif [ "${alert}" == "config" ]; then
|
||||||
fn_alert_config
|
fn_alert_config
|
||||||
fi
|
fi
|
||||||
|
@ -154,7 +154,7 @@ fn_monitor_check_update_source() {
|
|||||||
fn_print_ok "Checking update: "
|
fn_print_ok "Checking update: "
|
||||||
fn_print_ok_eol_nl
|
fn_print_ok_eol_nl
|
||||||
fn_script_log_info "Checking update: Monitor is restarting ${selfname} to apply update"
|
fn_script_log_info "Checking update: Monitor is restarting ${selfname} to apply update"
|
||||||
alert="restart"
|
alert="update-restart"
|
||||||
alert.sh
|
alert.sh
|
||||||
command_restart.sh
|
command_restart.sh
|
||||||
core_exit.sh
|
core_exit.sh
|
||||||
@ -177,7 +177,6 @@ fn_monitor_check_session() {
|
|||||||
fn_script_log_error "Checking session: There are PIDS with identical tmux sessions running"
|
fn_script_log_error "Checking session: There are PIDS with identical tmux sessions running"
|
||||||
fn_script_log_error "Checking session: Killing all tmux sessions with the socketname name ${socketname} and session name ${sessionname}"
|
fn_script_log_error "Checking session: Killing all tmux sessions with the socketname name ${socketname} and session name ${sessionname}"
|
||||||
pkill -f "tmux -L ${socketname} new-session -d -x ${sessionwidth} -y ${sessionheight} -s ${sessionname}"
|
pkill -f "tmux -L ${socketname} new-session -d -x ${sessionwidth} -y ${sessionheight} -s ${sessionname}"
|
||||||
command_restart.sh
|
|
||||||
core_exit.sh
|
core_exit.sh
|
||||||
# Check for tmux pids with the same tmux session and socket names. This will reduce issues with migration to release v23.5.0. #4296
|
# Check for tmux pids with the same tmux session and socket names. This will reduce issues with migration to release v23.5.0. #4296
|
||||||
elif [ "$(pgrep -fc -u "${USER}" "tmux -L ${sessionname} new-session -d -x ${sessionwidth} -y ${sessionheight} -s ${sessionname}")" != "0" ]; then
|
elif [ "$(pgrep -fc -u "${USER}" "tmux -L ${sessionname} new-session -d -x ${sessionwidth} -y ${sessionheight} -s ${sessionname}")" != "0" ]; then
|
||||||
@ -187,7 +186,15 @@ fn_monitor_check_session() {
|
|||||||
fn_script_log_error "Checking session: PIDS with the same tmux session and socket names are running"
|
fn_script_log_error "Checking session: PIDS with the same tmux session and socket names are running"
|
||||||
fn_script_log_error "Checking session: Killing session with the socketname name ${sessionname} and session name ${sessionname}"
|
fn_script_log_error "Checking session: Killing session with the socketname name ${sessionname} and session name ${sessionname}"
|
||||||
pkill -f "tmux -L ${sessionname} new-session -d -x ${sessionwidth} -y ${sessionheight} -s ${sessionname}"
|
pkill -f "tmux -L ${sessionname} new-session -d -x ${sessionwidth} -y ${sessionheight} -s ${sessionname}"
|
||||||
command_restart.sh
|
core_exit.sh
|
||||||
|
# Check for tmux pids that are using the old type of tmux session. This will reduce issues with migration to release v23.5.0. #4296
|
||||||
|
elif [ "$(pgrep -fc -u "${USER}" "tmux new-session -d -x ${sessionwidth} -y ${sessionheight} -s ${sessionname}")" != "0" ]; then
|
||||||
|
fn_print_error "Checking session: PIDS with old type tmux session are running: "
|
||||||
|
fn_print_error_eol_nl
|
||||||
|
fn_script_log_error "Checking session: ERROR"
|
||||||
|
fn_script_log_error "Checking session: PIDS with old type tmux session are running"
|
||||||
|
fn_script_log_error "Checking session: Killing session with the session name ${sessionname}"
|
||||||
|
pkill -f "tmux new-session -d -x ${sessionwidth} -y ${sessionheight} -s ${sessionname}"
|
||||||
core_exit.sh
|
core_exit.sh
|
||||||
elif [ "${status}" != "0" ]; then
|
elif [ "${status}" != "0" ]; then
|
||||||
fn_print_ok "Checking session: "
|
fn_print_ok "Checking session: "
|
||||||
|
Loading…
Reference in New Issue
Block a user