#!/bin/sh
#
# Cygnus Crontab Script - Restart Cygnus if needed
#
# Instructions for installing this script can be found in the crontab file.

# Change this to the directory for Cygnus (This is the default)
cd ~/services

# Leave the rest alone.

if [ -f cygnus.pid ] ; then
  PID=`cat cygnus.pid`
  if `kill -CHLD $PID >/dev/null 2>&1`; then
    exit 0
  fi
  rm -f cygnus.pid
fi

./cygnus
exit 0
