#!/bin/bash
##
### BEGIN INIT INFO
# Provides:          haveged
# Required-Start: 
# Should-Start: 
# Required-Stop: 
# Should-Stop: 
# Default-Start:     3 5
# Default-Stop:      0 1 2 6
# Short-Description: Daemon to feed entropy into /dev/urandom
# Description:       
# The haveged daemon uses the timing variations that occur in executing a fixed loop
# to generate random numbers that are fed into the random pool.
### END INIT INFO

prog="haveged"

. /etc/rc.status
rc_reset

case "$1" in
start)
  echo -n $"Starting $prog: "
  startproc /usr/sbin/$prog -w 1024 -v 1
  rc_status -v
  ;;

stop)
  echo -n $"Stopping $prog: "
  killproc -TERM /usr/sbin/$prog
  rc_status -v  
;;

restart)
  $0 stop
  $0 start
  ;;

*)
  echo "usage: $prog [start|stop|restart]"
esac
exit $RETVAL
