I once made this script which used CRON to be run every minute. Here's what the script did:
I ran a game server for a game called Neverwinter Nights. If the server crashed and I wasn't home, I couldn't reset it and all my regular players would be out of luck until I could put the server back up. So I wrote this script that did something like "grep" and check the results for a certain string. If the string was found, then I the server was running. If the string was not found, it would execute the command to start up the server. I lost that script, and haven't done anything in linux since. Now a friend wants it who runs a server.
Could somebody just write some pseudo code for me for how to do this? And any linux-specific commands I'll need in writing it?