Same as dyndns. Only two files are needed like this. Offcorse this just an example.
Code:
#!/bin/sh
while [ 1=1 ];
do
if [ ! "$(pidof CCcam)" ]
then
echo "Dead at `date`" >> /var/log/CCcam_Check.log | /usr/bin/CCcam &
fi
sleep 10
done
and for the daemon
Code:
#!/bin/sh
set -e
DESC="CCcam Process Checker"
NAME="CCcam"
DAEMON="/var/script/CCcam_Check"
test -x $DAEMON || exit 0
case "$1" in
start) echo "Starting $DESC"
$DAEMON &
exit $?
;;
stop) echo "Stopping $DESC"
pkill $NAME
exit $?
;;
*) echo "Usage: /etc/init.d/CCcam_Check {start|stop}"
exit 2
;;
esac
exit 0