Class RestartRunner

java.lang.Object
com.gmt2001.util.RestartRunner
All Implemented Interfaces:
Listener

public final class RestartRunner extends Object implements Listener
Restarts the bot, if configured appropriately
Author:
gmt2001
  • Method Details

    • instance

      public static RestartRunner instance()
      Gets an instance
      Returns:
    • register

      public void register()
    • onWebPanelSocketUpdateEvent

      public void onWebPanelSocketUpdateEvent(WebPanelSocketUpdateEvent event)
      Handles WebSocketUpdateEvent
      Parameters:
      event -
    • canRestart

      public boolean canRestart()
      Returns true if a command is present. Does not indicate if OS permissions will allow it to succeed
      Returns:
    • restartBot

      public void restartBot()
      Attempts to restart the bot using the preferred OS Interpreter. The result is broadcast to all panel WebSockets The broadcast of the 0 exit code may not always work depending on timings of the bot shutdown and the method used to initiate the shutdown