[Solved] restart function doesn't work
#3
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:

#!/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.
Reply
Thanks given by: xelor , marcdraco


Messages In This Thread
[Solved] restart function doesn't work - by xelor - 05-03-2016, 01:49 AM
RE: restart function dont works - by LogicParrot - 05-03-2016, 04:24 AM
RE: restart function doesn't work - by LogicParrot - 05-03-2016, 04:35 AM
RE: restart function doesn't work - by xelor - 05-03-2016, 07:19 AM



Users browsing this thread: 2 Guest(s)