Help with script for Ccam on tsimage

eaZy

Registered
Messages
8
Hi, I try to activate a script that checks my Ccam and restart it if its dead.
I put the script in /cron/scripts and try to test it Cron Manager but only get:
syntax error on line 8: unexpected "fi" (expecting "then")

Here is my script:

#!/bin/sh
if ps x |grep -v grep |grep -c CCcam >/dev/null
then
echo "cccam... ok"
else
echo "cccam... restarting"
/usr/bin/cam/CCcam_2.3.0. &
fi

Im using TS Image 3.0 (latest august/september).

Please give me some help if you know more about the functions :)

(And yes the rights on the file is changed to 755.)
 

^G@w@in^

Senior Member
Messages
236
Have you checked other scripts ?

Here is Black Hole one
#!/bin/sh

CAMNAME="CCcam_2.3.0"

remove_tmp () {
rm -rf /tmp/*.info* /tmp/*.tmp*
}

case "$1" in
start)
echo "[SCRIPT] $1: $CAMNAME"
remove_tmp
/usr/bin/CCcam_230 &
;;
stop)
echo "[SCRIPT] $1: $CAMNAME"
killall -9 CCcam_230 2>/dev/null
sleep 1
remove_tmp
;;
*)
$0 stop
exit 0
;;
esac

exit 0

If the only difference is the bin location then just edit it with a decent editor like crimson editor or notepad ++
 

eaZy

Registered
Messages
8
Thanx, but still errors..

line 2 : not found
line 4: not found
line 7: not found
line 8: not found
line 9 : syntax error: unexpected word (expecting "in")


But still thank you for the tips :) If any others also can help it would be nice.

If also anyone know about the ts image, maybe the problem is there? I have run the CCcam script on previous versions of TS image...
 
Top