#!/bin/sh
#
# sshd          This shell script takes care of starting and stopping sshd.
#
# chkconfig: 2345 55 45
# description: Sshd allows users to connect to your computer over the network #              in a secure way.
# processname: sshd
# config: /etc/sshd

# 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/sbin/sshd ] || exit 0

# See how we were called.
case "$1" in
  start)
        # Start daemons.
        echo -n "Starting sshd: "
        /usr/sbin/sshd
        echo ssh
        ;;
  stop)
        # Stop daemons.
        echo -n "Shutting down sshd: "
        killproc sshd
        echo "done"
        ;;

  status)
        status sshd
        ;;

  restart|reload)
        $0 stop
        $0 start
        ;;

  *)
        echo "Usage: ssh {start|stop}"
        exit 1
esac

exit 0
