
The amount of memory remaining before an automatic restart occurs can be customized. You can also configure the number of seconds between checking the amount of memory, as well as the messages displayed before and after the restart.
Official Website: MC.Candy-Sky.Net

Permissions is "smartrestart.sr"
# Designing by Taiwanese from Candy-sky.net # Check the time in seconds interval check-mem-time: 5 # Restart at least how much memory? free-mem: 100 # Restart messages closeinga-message: "Server out of memory! Restarting to ensure server stability. Do not shut down the server manually." closeingb-message: "Server shutting down in 10 seconds, log out now!" # message to display to kicked players restart-message: "Please wait 30 seconds before logging in to ensure system stability"
@ECHO OFF :restart echo run server now , you can't close java -Xmx1024M -Xms1024M -jar craftbukkit.jar echo Restart after 5 seconds , you can close now ping -n 2 -w 500 0.0.0.1>nul echo Restart after 4 seconds , you can close now ping -n 2 -w 500 0.0.0.1>nul echo Restart after 3 seconds , you can close now ping -n 2 -w 500 0.0.0.1>nul echo Restart after 2 seconds , you can close now ping -n 2 -w 500 0.0.0.1>nul echo Restart after 1 seconds , you can close now ping -n 2 -w 500 0.0.0.1>nul goto restart
#!/bin/sh BINDIR=$(dirname "$(readlink -fn "$0")") cd "$BINDIR" while : ; do echo "run server now , you can't close" java -Xmx1024M -Xms1024M -jar craftbukkit.jar echo "Restart after 5 seconds , you can close now" sleep 1 echo "Restart after 4 seconds , you can close now" sleep 1 echo "Restart after 3 seconds , you can close now" sleep 1 echo "Restart after 2 seconds , you can close now" sleep 1 echo "Restart after 1 seconds , you can close now" sleep 1 done
Theoretical writing Not been tested
#!/bin/bash cd "$( dirname "$0" )" while : ; do echo "run server now , you can't close" java -Xms1024M -Xmx1024M -jar craftbukkit.jar -o true echo "Restart after 5 seconds , you can close now" sleep 1 echo "Restart after 4 seconds , you can close now" sleep 1 echo "Restart after 3 seconds , you can close now" sleep 1 echo "Restart after 2 seconds , you can close now" sleep 1 echo "Restart after 1 seconds , you can close now" sleep 1 done