diff options
Diffstat (limited to 'other/openssh-reverse/contrib/redhat/sshd.init')
| -rwxr-xr-x | other/openssh-reverse/contrib/redhat/sshd.init | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/other/openssh-reverse/contrib/redhat/sshd.init b/other/openssh-reverse/contrib/redhat/sshd.init new file mode 100755 index 0000000..cac91bb --- /dev/null +++ b/other/openssh-reverse/contrib/redhat/sshd.init | |||
| @@ -0,0 +1,60 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | |||
| 3 | # Init file for OpenSSH server daemon | ||
| 4 | # | ||
| 5 | # chkconfig: 2345 55 25 | ||
| 6 | # description: OpenSSH server daemon | ||
| 7 | # | ||
| 8 | # processname: sshd | ||
| 9 | # config: /etc/ssh/ssh_host_key | ||
| 10 | # config: /etc/ssh/ssh_host_key.pub | ||
| 11 | # config: /etc/ssh/ssh_random_seed | ||
| 12 | # config: /etc/ssh/sshd_config | ||
| 13 | # pidfile: /var/run/sshd.pid | ||
| 14 | |||
| 15 | # source function library | ||
| 16 | . /etc/rc.d/init.d/functions | ||
| 17 | |||
| 18 | RETVAL=0 | ||
| 19 | |||
| 20 | case "$1" in | ||
| 21 | start) | ||
| 22 | echo -n "Starting sshd: " | ||
| 23 | if [ ! -f /var/run/sshd.pid ] ; then | ||
| 24 | case "`type -type success`" in | ||
| 25 | function) | ||
| 26 | /usr/sbin/sshd && success "sshd startup" || failure "sshd startup" | ||
| 27 | RETVAL=$? | ||
| 28 | ;; | ||
| 29 | *) | ||
| 30 | /usr/sbin/sshd && echo -n "sshd " | ||
| 31 | RETVAL=$? | ||
| 32 | ;; | ||
| 33 | esac | ||
| 34 | [ $RETVAL -eq 0 ] && touch /var/lock/subsys/sshd | ||
| 35 | fi | ||
| 36 | echo | ||
| 37 | ;; | ||
| 38 | stop) | ||
| 39 | echo -n "Shutting down sshd: " | ||
| 40 | if [ -f /var/run/sshd.pid ] ; then | ||
| 41 | killproc sshd | ||
| 42 | fi | ||
| 43 | echo | ||
| 44 | [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/sshd | ||
| 45 | ;; | ||
| 46 | restart) | ||
| 47 | $0 stop | ||
| 48 | $0 start | ||
| 49 | RETVAL=$? | ||
| 50 | ;; | ||
| 51 | status) | ||
| 52 | status sshd | ||
| 53 | RETVAL=$? | ||
| 54 | ;; | ||
| 55 | *) | ||
| 56 | echo "Usage: sshd {start|stop|restart|status}" | ||
| 57 | exit 1 | ||
| 58 | esac | ||
| 59 | |||
| 60 | exit $RETVAL | ||
