AW: CCcam 2.2.1 Restart/CCcamcheck
#!/bin/sh
# CCcam Autostartscript – mod by KNC
# starts via cron to check if CCcam is running
# If CCCam is not running, it restarts CCCam
#user and pass from the webinfo page
USERNAME="XXXX"
PASSWORD="YYYY"
CAMVERSION="2.2.0"
##CAMVERSION="2.2.0_oscam_1.0"
if ps x |grep -v grep |grep -c CCcam >/dev/null
then
if wget http://"$USERNAME":"$PASSWORD"@127.0.0.1:16001 -O - > /dev/null
then
echo "CCcam $CAMVERSION is running"
#echo "CCcam "$CAMVERSION" is running: " `date` >> /tmp/CCcam_Restart.log
else
echo "CCcam $CAMVERSION is not running and needs to restart"
/var/script/CCcam_"$CAMVERSION"_cam.sh stop
/var/script/CCcam_"$CAMVERSION"_cam.sh start
echo "CCcam "$CAMVERSION" restart: " `date` >> /tmp/CCcam_Restart.log
fi
else
echo "CCcam $CAMVERSION is not running and needs to restart"
/var/script/CCcam_"$CAMVERSION"_cam.sh stop
/var/script/CCcam_"$CAMVERSION"_cam.sh start
echo "CCcam "$CAMVERSION" restart: " `date` >> /tmp/CCcam_Restart.log
fi
exit
Username und Passwort müssen die in " " gesetzt werden ??
Und muss die "$Camversion" in die " " und ersetzt werden ??
Also so hier:
#!/bin/sh
# CCcam Autostartscript – mod by KNC
# starts via cron to check if CCcam is running
# If CCCam is not running, it restarts CCCam
#user and pass from the webinfo page
USERNAME=Hans
PASSWORD=Mustermann
CAMVERSION=2.0.11
if ps x |grep -v grep |grep -c CCcam >/dev/null
then
if wget
-O - > /dev/null
then
echo "CCcam 2.0.11 is running"
#echo "CCcam "2.0.11" is running: " `date` >> /tmp/CCcam_Restart.log
else
echo "CCcam 2.0.11 is not running and needs to restart"
/var/script/CCcam_"2.0.11"_cam.sh stop
/var/script/CCcam_"2.0.11"_cam.sh start
echo "CCcam "2.0.11" restart: " `date` >> /tmp/CCcam_Restart.log
fi
else
echo "CCcam $CAMVERSION is not running and needs to restart"
/var/script/CCcam_"$CAMVERSION"_cam.sh stop
/var/script/CCcam_"$CAMVERSION"_cam.sh start
echo "CCcam "$CAMVERSION" restart: " `date` >> /tmp/CCcam_Restart.log
fi
exit