#!/bin/sh
# Startup script for anacron
#
# chkconfig: 2345 95 05
# description: Run cron jobs that were left out due to downtime

# Source function library.
. /etc/rc.d/init.d/functions

[ -f /usr/sbin/anacron ] || exit 0

prog="anacron"

start() {
    echo -n $"Starting $prog: " 
    daemon +19 anacron -s
    RETVAL=$?
    echo
    return $RETVAL
}

stop() {
    if test "x`pidof anacron`" != x; then
	echo -n $"Stopping $prog: "
	killproc anacron
	echo
    fi
    RETVAL=$?
    return $RETVAL
}

case "$1" in
	start)
	    start
	    ;;
	
	stop)
	    stop
	    ;;
	
	status)
	    status anacron
	    ;;
	restart)
	    stop
	    start
	    ;;
	condrestart)
	    if test "x`pidof anacron`" != x; then
		stop
		start
	    fi
	    ;;
	
	*)
	    echo $"Usage: $0 {start|stop|restart|condrestart|status}"
	    exit 1

esac

exit $RETVAL