123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122 |
- #! /bin/sh
- SSHD_BIN=/usr/sbin/sshd
- test -x $SSHD_BIN || exit 5
- SSHD_SYSCONFIG=/etc/sysconfig/ssh
- test -r $SSHD_SYSCONFIG || exit 6
- . $SSHD_SYSCONFIG
- SSHD_PIDFILE=/var/run/sshd.init.pid
- . /etc/rc.status
- rc_reset
- case "$1" in
- start)
-
- ssh-keygen -A
- echo -n "Starting SSH daemon"
-
-
- startproc -f -p $SSHD_PIDFILE $SSHD_BIN $SSHD_OPTS -o "PidFile=$SSHD_PIDFILE"
-
- rc_status -v
- ;;
- stop)
- echo -n "Shutting down SSH daemon"
-
-
- killproc -p $SSHD_PIDFILE -TERM $SSHD_BIN
-
- rc_status -v
- ;;
- try-restart)
-
-
- $0 status >/dev/null && $0 restart
-
- rc_status
- ;;
- restart)
-
-
- $0 stop
- $0 start
-
- rc_status
- ;;
- force-reload|reload)
-
-
- echo -n "Reload service sshd"
- killproc -p $SSHD_PIDFILE -HUP $SSHD_BIN
- rc_status -v
- ;;
- status)
- echo -n "Checking for service sshd "
-
-
-
-
-
-
-
- checkproc -p $SSHD_PIDFILE $SSHD_BIN
- rc_status -v
- ;;
- probe)
-
-
- test /etc/ssh/sshd_config -nt $SSHD_PIDFILE && echo reload
- ;;
- *)
- echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload|probe}"
- exit 1
- ;;
- esac
- rc_exit
|