Hello,
I am setting up a CCcamCheck.sh script, if i start the script i get this back:
i was wondering of the script i used is correct can someone check it? it need to restart the CCcam if it is stoped or is frozen
Bash
#!/bin/sh
PID=`ps -ef|grep /usr/local/bin/CCcam|grep -v grep|wc -l`
if [ $PID -eq 0 ]; then
echo "cccam... down"
echo "restart.. cccam"
/usr/local/bin/CCcam &
else
echo "cccam... ok"
fi
if i do: crontab -e
i get this code:
and i can see in the CCcamCheck.log this:
cccam... ok
cccam... ok
cccam... ok
cccam... ok
cccam... ok
cccam... ok
cccam... ok
cccam... ok
cccam... ok
So the script is working, the question that i also have is that i would get a time stamp and date in the logfile, who can help?