Script to auto restart oscam

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • smoggie
    DK Veteran
    • Jul 2008
    • 863

    #1

    Script to auto restart oscam

    Looking for a script to do as per title. I have looked around but still a bit unsure
    the file path for command should be var/bin
    I think the paths for the script need to to go to var/script
    I believe this needs to to be set to run in crond every so often to make sure its running

    how does this look??

    #!/bin/sh
    process=`ps auxwww | grep oscam | grep -v grep | awk '{print $1}'`
    if [ -z "$process" ]; then
    echo "Couldn't find Oscam running. Restarting server-binary" >> /var/cccamlog/oscam.check
    echo && date >>/var/cccamlog/oscam.check
    /var/bin/oscam >> /var/cccamlog/Oscam.log &
    else echo "Oscam is still OK!" >> /var/cccamlog/oscam.check
    fi
Working...