2023-01-26 23:15:40 +00:00
|
|
|
# Minecraft server automatic startup and shutdown
|
|
|
|
|
2023-01-26 23:43:47 +00:00
|
|
|
A collection of scripts to start a Minecraft server on Digitalocean on demand
|
|
|
|
and automatically shut it down when not in use.
|
|
|
|
|
|
|
|
## Installation and Usage
|
|
|
|
|
2023-01-26 23:15:40 +00:00
|
|
|
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:
|
|
|
|
|
2023-01-26 23:45:17 +00:00
|
|
|
`*/5 * * * * root /your/path/here/mineautoshutdown.sh 2>&1 | logger`
|
2023-01-26 23:15:40 +00:00
|
|
|
|
|
|
|
Ensure the same password is present in the php script and the shutdown script.
|
2023-01-26 23:43:47 +00:00
|
|
|
Review all other files to make sure passwords/keys/hostnames are correct.
|
2023-01-26 23:15:40 +00:00
|
|
|
|
|
|
|
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.
|
2023-01-26 23:43:47 +00:00
|
|
|
|
|
|
|
## License
|
|
|
|
|
|
|
|
Copyright (C) 2023 zyphlar
|
|
|
|
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|