$tool_message_update_lang = $_POST['tool_form_message_lang']; $tool_error = tool_admin_restart_messages_update($tool_message_update_id, $tool_message_update_name, $tool_message_update_value, $tool_message_update_lang); if ($tool_error != "") { $tpl->assign('tool_alert_message', $tool_error); } $_GET['msg_id'] = $tool_message_update_id; //break; //break; case 'editmsg': /* * ------------------------------------------------------------------------------------------- * Edit an existing Restart Message * ------------------------------------------------------------------------------------------- */ $tool_message_edit_id = $_GET['msg_id']; $tool_message_edit_data = tool_admin_restart_messages_get_id($tool_message_edit_id); $tpl->assign('tool_message_edit_data', $tool_message_edit_data); break; case 'delete message': /* * ------------------------------------------------------------------------------------------- * Delete an existing Restart Message * ------------------------------------------------------------------------------------------- */ $tool_message_delete_id = $_POST['tool_form_message_id']; if (!($tool_message_delete_id > 0)) { $tpl->assign('tool_alert_message', "/!\\ Error: invalid restart message!"); } else { tool_admin_restart_messages_del($tool_message_delete_id); } break;
// we don't want more than 1 client executing the restart commands if they think they still have the lock if (isset($tool_restart_info) && $tool_restart_info['restart_sequence_user_name'] == $nel_user['user_name'] && tool_admin_applications_check('tool_main_easy_restart')) { $tool_seq_id = $NELTOOL['POST_VARS']['restart_sequence_id']; $tool_seq_step = $NELTOOL['POST_VARS']['restart_sequence_step']; $restart_shard_id = $NELTOOL['POST_VARS']['restart_shard_id']; $service_su = $NELTOOL['POST_VARS']['restart_su']; $service_egs = $NELTOOL['POST_VARS']['restart_egs']; $restart_stop_services = $NELTOOL['POST_VARS']['restart_stop_services']; if (isset($NELTOOL['POST_VARS']['restart_check_ws'])) { // we are starting the restart sequence $restart_ws_state = $NELTOOL['POST_VARS']['restart_ws_state']; if ($restart_ws_state == 'open') { // shard needs a regular restart // - broadcast a message on the shard $restart_reboot_message_id = $NELTOOL['POST_VARS']['restart_message_reboot_id']; $restart_reboot_message_data = tool_admin_restart_messages_get_id($restart_reboot_message_id); $restart_reboot_message = $restart_reboot_message_data['restart_message_value']; if ($restart_reboot_message != '') { $service_command = "broadcast repeat=10 every=60 " . $restart_reboot_message; nt_log("Domain '{$AS_Name}' : '{$service_command}' on " . $service_egs); nt_common_add_debug("about to run command '{$service_command}' on '{$service_egs}' ..."); $adminService->serviceCmd($service_egs, $service_command); if (!$adminService->waitCallback()) { nt_common_add_debug('Error while waiting for callback on service \'' . $service_egs . '\' for command : ' . $service_command); } $tpl->clear_assign('tool_execute_result'); } // - prepare next step (timer countdown to 10 minutes) if ($restart_shard_id == 301) { // Fast restart for yubo shard (1mn) tool_main_set_restart_sequence_timer($tool_seq_id, 60);