All pastes #833595 Raw Edit

Anonymous

public shellscript v1 · immutable
#833595 ·published 2007-12-27 12:36 UTC
rendered paste body
#!/bin/sh### Set your default mangos Root Directorymangosdir="/home/tatara/wow/bin"### Set your mangos options i.e. conf location etcmangosconf="-c /home/tatara/wow/etc/mangosd.conf"### Set your mangos Binary Namemangosbin="mangos-worldd"### Set your screen name heremangossname="mangosd"### Set your mangos Pid Filemangospid="mangosd.pid"########## you probably don't need to change anything below here ############# PID Writer dont change unless you know what you are doingmangospidrite="ps -e | awk '/$mangosbin/ && !/awk/ {print $1}' > $mangosdir/$mangospid"cd $mangosdir# is there a pid file?if test -r $mangospidthen  # there is a pid file -- is it current?  pid=`cat $mangospid`  if `kill -CHLD $pid >/dev/null 2>&1`  then    echo "$mangosbin is currently running...."    exit 0  fi  echo ""  echo "Stale $mangospid file, erasing..."  echo "Attempting to Restart mangosd"  rm -f $mangospid  screen -A -m -d -S $mangossname ./$mangosbin $mangosconf  $mangospidriteelseecho "$mangospid appears to be missing. Attempting to Restart mangosd"screen -A -m -d -S $mangossname ./$mangosbin $mangosconf$mangospidritefi