Start a timer and notify your online users before shutting the server down. The notice repeats so often until the task is cancelled or til the timer hits 0 at which the server will automatically shutdown. Simply use this plugin instead of /stop to shutdown your server and the plugin will take care of the rest.
There is auto-restart support when using a compatible startup script (examples provided below). When you start the server using a compatible restart script the server will auto restart when using the /restart or /reboot aliased commands.
The server list ping motd can also optionally be overridden to display any shutdown notifications.
Everything is configurable, from the broadcast messages, to the notice times, to the pre-shutdown commands to automatically perform.
Sorry about the funky recording. :S
/shutdown [time (reason) | cancel] Shutdown the server after a delay. (Aliases: restart, reboot)
command.shutdown Allow player to use /shutdown command.
1 2 3 4 5 6 7 8 9 10 11 12 13
# Enable debug info in console debug-mode: false # Enable colors in console output color-logs: true # Update the server list ping MOTD to show when server is scheduled for shutdown/restart update-ping-motd: true # Commands to perform just before the server shuts down shutdown-commands: - say Goodbye. - kickall
Example Auto-Restart Startup Scripts
For Linux (start.sh):
1 2 3 4 5 6 7 8 9 10 11
#!/bin/sh while $RELOAD do RELOAD=false java -Xmx4096M -Xms1024M -jar spigot-1.8.3.jar -o true if [ -f plugins/ShutdownNotice/restart ]; then RELOAD=true echo "Restarting server in 5 seconds..." sleep 5 fi done
For Windows (start.bat) untested:
1 2 3 4 5 6 7 8 9
@echo off :start java -Xmx4096M -Xms1024M -XX:MaxPermSize=128M -jar spigot-1.8.3.jar -o true if exists plugins\ShutdownNotice\restart ( echo "Restarting server in 5 seconds..." timeout /t 5 /nobreak > NUL goto start ) pause
As you can see, the script simply has to check for the "restart" file in the plugin's directory and perform a restart when one is found. Simple.
- Add variable broadcast delay (you set how often to send title/chat broadcasts)
- Implement real time schedules (For example: Restart server every night at midnight. Etc)
Have a suggestion? Leave a comment!
This plugin uses metrics to collect stats! It only collect basic things such as version type, and players online. If you want to see everything, click on the graph. Go into /plugins/PluginMetrics/config.yml to disable stat collecting if you wish.