Package com.gmt2001.util
Class RestartRunner
java.lang.Object
com.gmt2001.util.RestartRunner
- All Implemented Interfaces:
Listener
Restarts the bot, if configured appropriately
- Author:
- gmt2001
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns true if a command is present.static RestartRunner
instance()
Gets an instancevoid
Handles WebSocketUpdateEventvoid
register()
void
Attempts to restart the bot using the preferred OS Interpreter.
-
Method Details
-
instance
Gets an instance- Returns:
-
register
public void register() -
onWebPanelSocketUpdateEvent
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
-