/root/daemon-gs01.sh
Code:
# - - - - - - BEGIN
# Sample Daemon Guard for World Map
#/bin/bash
if ps ax | grep -v grep | grep 'gs gs01' > /PWServer/logs >> daemon-gs01.log
then
echo "Main World [GS01] is RUNNING."
else
echo "Main World [GS01] is DOWN!!! Attempting to restart GS01..."
echo "Starting GS01..."
cd /PWServer/gamed
./gs gs01
fi
# - - - - - - END
/etc/crontab
Code:
10 * * * * /root/daemon-gs01.sh
Now you need to figure by yourself how it works and how to make it working on your server...