I have a cron shell script that recompiles MCServer every night. How would I safely shutdown and/or restart MCServer from this script? (MCServer runs from screen)
Use a RCON client to send it the "stop" command.
We have a RCONClient tool in the Tools folder, but I haven't compiled it for anything else than windows yet, so it might take some work.
Code:
echo "stop" > /proc/?/fd/0
Maybe that would work?
Might, but I'm running in a screen session so I used:
screen -S mcserver -p 0 -X stuff "stop$(printf \\r)"