Hi,
i have a Telnet-Check Script running on my Debian Server with cron every 2 minutes.
If CCCam is not responding, it will be restartet. It logs the date & time on restart.
Here's the scipt:
Code:
#!/bin/sh
CHECKNAME="CCCam_test.txt"
IP="127.0.0.1"
PORT="16000"
echo info|nc $IP $PORT >>/tmp/$CHECKNAME
set $(ls -s /tmp/$CHECKNAME)
if [ "$1" = "0" ];
then
echo "CCcam is not running, Restarting..."
echo `date` CCCam Neustart >> /var/log/CCCam_Reset.txt
sleep 2
/etc/init.d/CCCam stop 2>/dev/null >/dev/null &
sleep 2
killall -9 CCCam.x86 2>/dev/null >/dev/null &
sleep 2
/etc/init.d/CCCam start 2>/dev/null >/dev/null &
sleep 3
#/etc/init.d/CCCam restart
else
echo "CCcam is running"
fi
rm /tmp/$CHECKNAME
exit
Greetz Orca74