#!/bin/sh
#=================================================================
# Begin smartd
#
# Description : self Monitoring and Reporting Technology (SMART) Daemon
#
#=================================================================

### BEGIN INIT INFO
# Provides:            $smartd
# Required-Start:      
# Should-Start:        $syslog 
# Required-Stop:       
# Should-Stop:         
# Default-Start:       3 4 5
# Default-Stop:        0 1 2 6
# Short-Description:   Starts smartd.
# Description:         Starts smartd daemon.
# X-LFS-Provided-By:   BLFS
### END INIT INFO

. /lib/lsb/init-functions

PROG="smartd"
BIN_FILE="/usr/sbin/$PROG"

case "$1" in
   start)
      log_info_msg "Starting $PROG..."
      start_daemon ${BIN_FILE}
      evaluate_retval
      ;;

   stop)
      log_info_msg "Stopping $PROG..."
      killproc ${BIN_FILE}
      evaluate_retval
      ;;

   restart)
      $0 stop
      sleep 1
      $0 start
      ;;

   status)
      statusproc ${BIN_FILE}
      ;;

   *)
      echo "Usage: $0 {start|stop|restart|status}"
      exit 1
      ;;
esac

# End /etc/init.d/smartd
