View Single Post
Old 04-22-2002, 03:10 PM   #57
MatrixCPA
Senior Member
 
Join Date: Apr 2002
Location: Southern California
Posts: 1,199
I run my servers inside of screen AND have auto-restart ability. My scripts look like so:

--startjk2--
#!/bin/csh
echo -n "Starting - "
date "+%D %H:%M:%S"
cd /usr/local/games/jk2
screen -d -m ./holdjk2


--holdjk2--
#!/bin/csh
echo Ok
while 1
date "+%D %H:%M:%S" >> /tmp/jk2_start.log
echo "JK2 Server Started." >> /tmp/jk2_start.log
sh startup.sh
date "+%D %H:%M:%S" >> /tmp/jk2_start.log
echo "JK2 Server crashed, Restarting." >> /tmp/jk2_start.log
sleep 5
end

My startup.sh is a standard command line startup. This setup not only uses screen and provides auto-restart, but it also generates a log letting me know how often and when my server has crashed.


"Do you expect me to talk?"

"No, Mr. Bond, I expect you to DIE."
MatrixCPA is offline   you may: quote & reply,