Remarks, HERE;
1. if you activate remove-tmp--you will not see the feedback of script -- on /var/log/oscam.check---because all the time when the oscam_rs is running, will remove the logs
But the process is running, and you can verify in var/log /messages from Kernel
2. you can delete remove_tmp from script if you want feedback in /var/log/oscam_restart_log.check
#!/bin/sh
remove_tmp () {
rm -rf /tmp/*.info* /tmp/*.tmp*
}
oscam_rs () {
killall -9 oscam_r5893 >/dev/null
sleep 6
remove_tmp
sleep 3
/usr/bin/oscam_r5893
}
if ! ps x | grep -v grep | grep -c /usr/bin/oscam_5893 >/dev/null
#or if ! ps x | grep -v grep | grep -c oscam_r5893 >/dev/null
then
oscam_rs
echo `date "+%d/%m/%y %R process was not working"` >> /var/log/oscam_restart_log.check # or oscam.check
elif
tail -8 /var/log/oscam.log |grep -v grep |grep -c ins40 >/dev/null
then
oscam_rs
echo `date "+%d/%m/%y %R ins40 error detected"` >> /var/log/oscam_restart_log.check
elif
tail -8 /var/log/oscam.log |grep -v grep |grep -c deadlock >/dev/null
then
oscam_rs
echo `date "+%d/%m/%y %R deadlock error detected"` >> /var/log/oscam_restart_log.check
else
echo "ok"
fi
#############################
if you want feedback in var/log , script will be,...like this
also you can put a stick, in USB and sent the oscam.check file-- there
====================
/var/log/oscam.log---------/media/usb/oscam.log ..........this is the simplest way.
/var/log/oscam.check---------/media/usb/oscam.check
myself I moved all .log and .check files in stick -- /media/usb/
or you can copy and afte delete,...
cp :/var/log/ *.* /media/usb
and after
del :/var/log/*.*
################################################################################
oscam_rs () {
killall -9 oscam_r5893 >/dev/null
#killall -9 oscam_r5893
sleep 6
/usr/bin/oscam_r5893
}
if ! ps x | grep -v grep | grep -c /usr/bin/oscam_5893 >/dev/null
#or if ! ps x | grep -v grep | grep -c oscam_r5893 >/dev/null
then
oscam_rs
echo `date "+%d/%m/%y %R process was not working"` >> /var/log/oscam_restart_log.check # or oscam.check
elif
tail -8 /var/log/oscam.log |grep -v grep |grep -c ins40 >/dev/null
then
oscam_rs
echo `date "+%d/%m/%y %R ins40 error detected"` >> /var/log/oscam_restart_log.check
elif
tail -8 /var/log/oscam.log |grep -v grep |grep -c deadlock >/dev/null
then
oscam_rs
echo `date "+%d/%m/%y %R deadlock error detected"` >> /var/log/oscam_restart_log.check
else
echo "ok"
fi
bye
Display MoreOscam check script for ultimo
1. Make a script like this and ftp to /usr/script where other scripts are for ex oscam_check
2. Make a cronjob for ex emu restart at a certain time
3. Go to /etc/bhcron and open files bh.cron and root
4. Add in both files below the lines a 5 min cron as you do in debian to check cccam or oscam and save files.
5. Do a hard reset and you will see in oscam.log that script works every 5 min and write log
#!/bin/sh
remove_tmp () {
rm -rf /tmp/*.info* /tmp/*.tmp*
}
oscam_rs () {
killall -9 oscam 2>/dev/null
sleep 3
remove_tmp
/usr/bin/oscam -b
}
if ! ps x |grep -v grep |grep -c /usr/bin/oscam >/dev/null
then
oscam_rs
echo `date "+%d/%m/%y %R process was not working"` >> /var/log/oscam_restart_log
elif
tail -8 /var/log/oscam.log |grep -v grep |grep -c ins40 >/dev/null
then
oscam_rs
echo `date "+%d/%m/%y %R ins40 error detected"` >> /var/log/oscam_restart_log
elif
tail -8 /var/log/oscam.log |grep -v grep |grep -c deadlock >/dev/null
then
oscam_rs
echo `date "+%d/%m/%y %R deadlock error detected"` >> /var/log/oscam_restart_log
else
echo "ok"
fi