#!/bin/sh
#
# blocksshd           This shell script takes care of
#
# chkconfig: - 55 45
# description: blocksshd daemon
# probe: true

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

# Source networking configuration.
. /etc/sysconfig/network

# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0

[ -f /usr/bin/blocksshd ] || exit 0

[ -f /etc/blocksshd.conf ] || exit 0

if [ -f /etc/sysconfig/blocksshd ] ; then
	. /etc/sysconfig/blocksshd
else
	exit 0
fi

DAEMON=blocksshd

start() {
        echo -n "Starting $DAEMON: "
        daemon /usr/bin/blocksshd --start
        RETVAL=$?
        echo
        [ $RETVAL = 0 ] && touch /var/lock/subsys/blocksshd
	$STARTCMD
        return $RETVAL
}

stop() {
        # Stop daemon.
        echo -n "Shutting down $DAEMON: "
        killproc /usr/bin/blocksshd #--stop
        RETVAL=$?
        echo
        [ $RETVAL = 0 ] && rm -f /var/lock/subsys/blocksshd
        $STOPCMD
}

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

  exit 0
