This ServerRestart.sh
was recommended to me to restart my game server on critical failure.
while true; do
LD_LIBRARY_PATH=lib ./Server
done
I "improved" it with this to delete the logs directory on each restart.
while true; do
rm -r /home/_jc3105/logs
LD_LIBRARY_PATH=lib ./Server
done
This particular server will restart if you delete the logs directory while it is running. My improvement causes it to sometimes double restart So i think this is the solution.
while true; do
sleep 4
rm -r /home/_jc3105/logs
LD_LIBRARY_PATH=lib ./Server
done
But i suspect it will also have a new problem. That sometimes for a brief second it falsely thinks the server needs restarting when it actually does not which was not a problem until i introduced the folder delete. Which if triggered will cause the server to restart as a result of deleting the logs files.
I want to auto restart the Game Server using a script.sh
. I'd like it to first wait. then recheck the true? condition.