#!/bin/sh
NAME="superpuper"
PIDFILE="/var/run/$NAME.pid"
test -s "$PIDFILE" || exit
PID="`cat $PIDFILE`"
ps "$PID" > /dev/null 2>&1 && exit
{ echo $NAME; date; } | mail -s "Resurrect dead service" root
/sbin/service $NAME start
* * * * * root /usr/local/bin/restart1