05-03-2016, 04:35 AM
(This post was last modified: 05-03-2016, 04:39 AM by LogicParrot.)
The problem with the above script is that you cannot easily stop Cuberite when you really want to. Here's a slightly more sophisticated version:
If you stop Cuberite normally, it will restart.
If you create a file called stop.txt, and then stop Cuberite, it will actually stop.
#!/bin/sh
if [ -f stop.txt ]; then rm stop.txt; fi # Remove stop.txt if it exists for some reason
while [ ! -f stop.txt ]; do # Keep restarting cuberite until user creates stop.txt
./cuberite
echo "Restarting Cuberite in 10 seconds..."
sleep 10
done
rm stop.txt # Clean up by removing stop.txt
If you stop Cuberite normally, it will restart.
If you create a file called stop.txt, and then stop Cuberite, it will actually stop.

