SimpleRestart v1.1.0 Download: Jar Only | Full Zip Source: GitHub SimpleRestart is a plugin which allows server operators to simply and easily reboot their server, as well as schedule automatic reboots of the server "for freshness". The plugin contains flexible yet straightforward commands, is easy to set up and use, and makes use of Permissions. It does this by simply emulating the console typing in the "stop" command then using a slightly modified startup shell script normally used to boot Bukkit servers to boot the server again. Simply copy SimpleRestart.jar and the SimpleRestart folder into the "plugins" subdirectory of your minecraft server. If you do not copy in the SimpleRestart folder, it will be created for you automatically, along with a default configuration file. Edit the configuration file (config.yml) as you see fit, then modify your server startup script so that it automatically reboots the server when it gets "/stop"ped. The default configuration file is mostly straight forward and contains numerous comments, however, each option is detailed below: auto-restart: enable / disable automatic, time-scheduled restarting. If this is set to "no" then the server will only ever restart when using the "/restart" command. auto-restart-interval: this is how often (in hours) the server will automatically restart itself (only if auto-restart is set to "yes") warn-times: Before the server restarts, it will send out a friendly warning to all connected players, this setting is a list that describes the amount of time (in minutes) before the server automatically reboots that players get warning of the reboot. For example: warn-times: [10, 5, 2, 1] will warn players at 10 minutes, 5 minutes, 2 minutes, and 1 minutes before the server reboots. warning-message: this is the message that will be displayed as a warning that the server will be restarting soon. You may use classic minecraft server colour codes (http://www.minecraftwiki.net/wiki/Classic_server_protocol#Color_Codes) and "%t"% to indicate how long before the server reboots. For example: will display "Server will be restarting in 5 minutes!" in red (with warn-time = 5) restart-message: this is the message that players will see when they are kicked from the server due to the automatic reboot. Again, colour codes can be used here. In order for this plugin to work properly, you will have to make a slight modification to your startup script (Server.bat on windows, minecraft.sh on Linux). This plugin works by simply scheduling regular "stops" of the server. Then when the server goes down, the startup script simply loops around and starts the server up again, with minimal mumbo-jumbo. This is accomplished in the startup scripts using infinite loops: For Windows, put ":start" on the line before what you want repeated, then "goto start" on the line after what you want repeated to make an infinite loop. Example Server.bat: Code: @ECHO OFF SET BINDIR=%~dp0 CD /D "%BINDIR%" :start "%ProgramFiles%\Java\jre6\bin\java.exe" -Xincgc -Xmx1G -jar craftbukkit-0.0.1-SNAPSHOT.jar goto start For Linux, put "while true" <new line> "do" on the lines before what you want repeated, and "done" on the line after to make an infinite loop. Example minecraft.sh: Code: #!/bin/sh BINDIR="\$(dirname "\$(readlink -fn "\$0")")" cd "\$BINDIR" while true do java -Xincgc -Xmx1G -jar craftbukkit-0.0.1-SNAPSHOT.jar echo "If you want to completely stop the server process now, press Ctrl+C before the time is up!" echo "Rebooting in:" for i in 5 4 3 2 1 do echo "$i..." sleep 1 done echo "Rebooting now!" done If you are using screen on linux, you may use something like this: Code: #!/bin/sh while true do screen -t "MinecraftServer" -S "MinecraftServer" bash -c 'java -Xms14000M -Xmx14000M -jar craftbukkit.jar nogui ; exit' echo "If you want to completely stop the server process now, press Ctrl+C before the time is up!" echo "Rebooting in:" for i in 5 4 3 2 1 do echo "$i..." sleep 1 done echo "Rebooting now!" done On Windows, to exit this infinite loop (i.e., take the server down for good), simply close the command window. On Linux, press "Ctrl+C" to cancel the process. ** Note: example startup scripts can be downloaded from the source repository! To use just about anything in the /restart or /reboot commands, users must have the permission "simplerestart.restart" To use the /restart time command, users must have the permission "simplerestart.time" To use the /memory command, users must have the permission "simplerestart.memory" All commands may be typed in the console (without the "/" of course) or by players in-game, and /restart and /reboot are synonyms for each other and can be used interchangeably. /restart help: gives a simple help menu /restart now: restarts the server immediately /restart time: informs you how much time is left before the server restarts /restart (h|m|s) <time>: turns automatic restarting on (if it was off) and reschedules the next automatic restart to be <time> (hours, minutes, or seconds) away from now. For example, to reboot the server in 15 minutes, use Where 'h' is for hours, 'm' is for minutes, and 's' is for seconds. /restart on: turns automatic restarting on (if disabled in configuration OR via commands. Will start the scheduler from the current time based on the settings in the configuration. /restart off: cancels any pending automatic restarts and prevents automatic restarts from happening until re-enabled /memory: displays the java runtime memory usage, useful for catching runaway plugins Changelog: v1.1.0 - Add multiple warnings and tidied up code a bit v1.0.1 - Added forced auto-save before reboot and separate permissions node for checking how long before restart v1.0.0 - Initial release. Compiled against CraftBukkit 953 and Bukkit 754.