#!/bin/sh
#
# scheduler: Startup Ahsay Online Backup Manager Scheduler
#
# chkconfig: 35 99 99
#
### BEGIN INIT INFO
# Provides:          scheduler
# Required-Start:    $local_fs $remote_fs $syslog 
# Required-Stop:     $local_fs $remote_fs $syslog 
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start daemon at boot time
# Description:       Running scheduler on system startup
### END INIT INFO

case "$1" in
'start')
        echo "Starting Ahsay Online Backup Manager Scheduler"
        APP_HOME=@sed.product.home@
        if [ -f "${APP_HOME}/bin/Scheduler.sh" ]; then
        su root -c "nohup sh \"${APP_HOME}/bin/Scheduler.sh\" > /dev/null"
        fi
        echo ""
        ;;
'stop')
        APP_HOME=@sed.product.home@
        if [ -f "${APP_HOME}/bin/StopScheduler.sh" ]; then
        sh "${APP_HOME}/bin/StopScheduler.sh"
        fi
        ;;
*)
        echo "Usage: $0 { start | stop }"
        ;;
esac

