#! /bin/sh
#
# AA Master Server - check alive
# Author: Tony Jackson

ulimit -c unlimited

### Master Directory
dir="/home/aa/master"

### Master Binary Name
bin="crmaster"

###############################
# Don't edit below this line! # 
###############################


cd $dir

# check server is running
echo "Checking for master server..."
if `pidof $bin >/dev/null 2>&1`
then
echo "Master server is currently running."
exit 0
else
echo "Master server not running - restarting..."
./$bin &
fi
