Thursday, June 23, 2011

script oscam auto restart when down working or not?

This script verify if oscam is running and if not they start oscam:
################################################
#!/bin/sh
if ps x |grep -v grep |grep -c oscam >/dev/null
then
echo "oscam... ok"
else
echo "oscam... restarting"
/var/script/CCcam_2.1.4_oscam_0.99.4_cam.sh start
################################################

1. put this lines into a file for ex: /var/script/Autooscam.sh
2. from blue pannel: Services/Daemons > activate crond
3. add a line in /var/spool/cron/crontabs/root for run AutoCCcam.sh at 32 minutes after the hour, or adjust the interval for your needs

# Run hourly cron jobs at 32 minutes after the hour:
32 * * * * /usr/script/Autooscam.sh

or "crontab -e root" to add the cron job: 32 * * * * /var/script/Autooscam.sh

No comments:

Post a Comment