Public Repository for the Magicbane Shadowbane Emulator
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
928 B

package engine.devcmd.cmds;
import engine.devcmd.AbstractDevCmd;
import engine.objects.AbstractGameObject;
import engine.objects.PlayerCharacter;
import org.pmw.tinylog.Logger;
/**
* @author Summary: Devcmd to reboot server
*/
public class RebootCmd extends AbstractDevCmd {
// Instance variables
public RebootCmd() {
super("reboot");
}
// AbstractDevCmd Overridden methods
@Override
protected void _doCmd(PlayerCharacter pc, String[] args,
AbstractGameObject target) {
try {
Runtime rt = Runtime.getRuntime();
rt.exec("./mbrestart.sh");
} catch (java.io.IOException err) {
Logger.info(err.getMessage());
}
}
@Override
protected String _getHelpString() {
return "Reboot server";
}
@Override
protected String _getUsageString() {
return "./reboot";
}
}