diff options
Diffstat (limited to 'contrib/redhat/sshd.init-5.x')
-rwxr-xr-x | contrib/redhat/sshd.init-5.x | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/contrib/redhat/sshd.init-5.x b/contrib/redhat/sshd.init-5.x new file mode 100755 index 000000000..e836b6919 --- /dev/null +++ b/contrib/redhat/sshd.init-5.x | |||
@@ -0,0 +1,61 @@ | |||
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 | ;; | ||
59 | esac | ||
60 | |||
61 | exit $RETVAL | ||