18 lines
772 B
Markdown
18 lines
772 B
Markdown
|
# 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.
|