Author Topic: Ubuntu nwserver watchdog script  (Read 486 times)

Legacy_Knight_Shield

  • Hero Member
  • *****
  • Posts: 812
  • Karma: +0/-0
Ubuntu nwserver watchdog script
« on: June 10, 2011, 03:11:47 am »


                Ok here is a script I put together after reading and trying many others.Comments please.

I use the awesome nwservctl.sh script to stop and start it ...trouble is if it crashes the in.fifo , out.fifo files are left in the directory and the nwservctl.sh will not start with them already in. 


<-------------begin script ----------------->

#!/bin/bash
cd /home/dan

if [ "$(pidof nwserver)" ] ; 

then
echo "nwserver already running..."

else

rm -f in.fifo
rm -f out.fifo

sleep 2s
./nwservctl.sh start

fi




<----------------------- end script ---------------->':blink:'
               
               

               


                     Modifié par Knight_Shield, 11 juin 2011 - 12:28 .