#!/bin/sh
#
# crontab script for ChatServices
#
# Change this to the directory where you installed it
prefix=$HOME/services/
pidfile=var/chatservices.pid
cd "$prefix" || {
echo "$0: couldn't cd to $prefix"
exit 1
}
if [ -f "$pidfile" ] ; then
PID=`cat "$pidfile"`
if kill -0 $PID >/dev/null 2>&1; then
exit 0
fi
rm -f "$pidfile"
fi
echo "$0: couldn't find ChatServices running, restarting..."
./bin/services
exit 0
