Restart FXServer on crash

With my other MPs i run a simple bash to restart them after a crash on my Debian 9 VPS, like so…

while true; do
./mta-server64
done

Despite this method working on a half dozen other MPs. I’ve been unable to reproduce this for FXServer due to the complex nature of its start up and my general lack of linux skills. Can someone convert the above to do as it does for my MTA server, restart FXServer after it crashes.

My /home/_fvm000/fx-server/run.sh is stock
which i usually start with

cd /home && cd server && cd fx-server-data
bash /home/server/fx-server/run.sh +exec server.cfg

Should try searching the forum. Maybe you will get “lucky” and find one already working…

Been searching for days. Found many that start FXServer, which is not the problem here. I need one that restarts on crash.

I guess it’s too big of a struggle for you to google for a function that checks every x amount of time if the server is running or not , isn’t it?

I use to use this for cfxserver but should work fine for FXserver given that you have a way of killing or stopping the server when you want.

autores(){
echo Starting 5M Server
./run.sh +exec server.cfg
echo 5M server has stopped.
echo restarting 5m server in 5 seconds
sleep 5
autores
}
autores
2 Likes

Nice script. Thank you for helping, Envious.