minecraft-minder/README.md

18 lines
772 B
Markdown
Raw Normal View History

2023-01-26 23:15:40 +00:00
# Minecraft server automatic startup and shutdown
Install the .php file on a webserver and configure the variables as desired.
Place the remaining files on a server with CRON (could be the same server, just
not inside the web folder) and run the shell script every 5 minutes:
`*/5 * * * * * /your/path/here/minecraftautoshutdown.sh`
Ensure the same password is present in the php script and the shutdown script.
Call the php script via HTTP using the correct password when players want to play:
`curl http://your.webserver.here/minecraft.php?action=on&password=your_password_here`
If the CRON job runs properly and has all the right variables/permissions/dependencies,
it will shut down the DO droplet about 30-40 minutes after no players are detected in the game.