#!/bin/bash
#
# Daemon Name: reveamr
#  
# description: 

prog=rebound
lockfile=/lib/reveAM/Cdata/$prog

start() { 
    #Make some checks for requirements before continuing
    [ -x /lib/reveAM/AntiMalware/scanner/$prog ] || exit 5

    # Start our daemon daemon
    echo -n $"Starting $prog: "
    $(daemon --pidfile /lib/reveAM/Cdata/${prog}.pid /lib/reveAM/AntiMalware/scanner/$prog)
    RETVAL=$?
    echo

    #If all is well touch the lock file
    [ $RETVAL -eq 0 ] && touch $lockfile
    return $RETVAL
}

stop() {
    echo -n $"Shutting down $prog: "
    kill $prog
    RETVAL=$?
    echo

    #If all is well remove the lockfile
    [ $RETVAL -eq 0 ] && rm -f $lockfile
    return $RETVAL
}

# See how we were called.
case "$1" in
  start)
        start
        ;;
  stop)
        stop
        ;;
  status)
        status $prog
        ;;
  restart)
        stop
        start
        ;;
   *)
        echo $"Usage: $0 {start|stop|status|restart}"
        exit 2
esac

