Skip to content

Restart ​

Description ​

Schedules daily server restarts, warns players before disconnecting them and requests server shutdown. A process supervisor or hosting panel must launch the server again after it exits.

Configuration ​

Default configuration ​

Restart.json
json
{
    "m_Enable": 0,
    "m_Schedules": [
        {
            "m_Hour": 2,
            "m_Minute": 0,
            "m_Active": 1
        },
        {
            "m_Hour": 6,
            "m_Minute": 0,
            "m_Active": 1
        },
        {
            "m_Hour": 10,
            "m_Minute": 0,
            "m_Active": 1
        },
        {
            "m_Hour": 14,
            "m_Minute": 0,
            "m_Active": 1
        },
        {
            "m_Hour": 18,
            "m_Minute": 0,
            "m_Active": 1
        },
        {
            "m_Hour": 22,
            "m_Minute": 0,
            "m_Active": 1
        }
    ],
    "m_Await": 2,
    "m_Reason": "The server is restarting. Wait a few minutes.",
    "m_Notification": "The server will restart in %TimeMinutes% minutes.",
    "m_Interval": [
        15,
        10,
        5,
        1
    ],
    "m_Webhook": ""
}

Options ​

OptionTypeDescription
m_EnableboolEnables the module with 1 and disables it with 0.
m_Schedulesarray<object>Daily schedules based on the server clock.
m_AwaitintPeriod in minutes between the start of the restart procedure and server exit. Players are disconnected during this period.
m_ReasonstringText shown to players disconnected during the restart procedure.
m_NotificationstringAdvance warning text. The module replaces %TimeMinutes% with minutes until the restart procedure starts.
m_Intervalarray<int>Minutes before the restart procedure at which an advance warning is sent.
m_WebhookstringDiscord webhook URL for advance warnings. Leave empty to disable delivery.

m_Schedules[] ​

OptionTypeDescription
m_HourintHour on the server clock.
m_MinuteintMinute within the scheduled hour.
m_ActiveboolEnables the schedule with 1 and disables it with 0.

Commands ​

/restart ​

The action is required. now starts the disconnect-and-shutdown procedure and waits m_Await before exiting. force requests server exit after two seconds. start resumes scheduled restarts, and stop pauses the schedule before the procedure starts. Use now or force only when you intend to interrupt the active session.

  • Syntax /restart <force|now|start|stop>.
  • Permission command.restart or root.
  • Example /restart now.

Permissions ​

Add command.restart to the group's m_Permissions in Permissions to manage the restart schedule or request shutdown through chat. The root permission also grants access.

Released under the MIT License.