CODE
# Restart server
0,2 * * * * /server/sv_up.sh >/dev/null 2>&1
0,2 * * * * /server/sv_up.sh >/dev/null 2>&1
In sv_up.sh:
CODE
#!/bin/sh
mtaserverdir="/server/"
process=`ps auxw | grep linuxq3ded | grep -v grep | awk '{print $11}'`
if [ -z "$process" ]; then
echo "Couldn't find MTA Server running, restarting it."
cd "$mtaserverdir"
nohup ./mtaserver +exec ffa.cfg &
echo ""
fi
mtaserverdir="/server/"
process=`ps auxw | grep linuxq3ded | grep -v grep | awk '{print $11}'`
if [ -z "$process" ]; then
echo "Couldn't find MTA Server running, restarting it."
cd "$mtaserverdir"
nohup ./mtaserver +exec ffa.cfg &
echo ""
fi
What im trying to do is make sv_up.sh run every 2 minutes.
And what I want sv_up.sh to do is start mtaserver.exe if it isnt running
Can anyone help me? It doesnt work
