Annotation of /trunk/openssh/sshd.rc
Parent Directory | Revision Log
Revision 28 -
(hide annotations)
(download)
Sat Jul 2 17:07:55 2005 UTC (19 years, 4 months ago) by niro
File size: 1488 byte(s)
Sat Jul 2 17:07:55 2005 UTC (19 years, 4 months ago) by niro
File size: 1488 byte(s)
new
1 | niro | 28 | #!/bin/bash |
2 | # $Header: /root/magellan-cvs/src/openssh/sshd.rc,v 1.1 2005-07-02 17:07:55 niro Exp $ | ||
3 | |||
4 | #%rlevels: 3:s 4:s 5:s 0:k 1:k 2:k 6:k | ||
5 | #%start: 30 | ||
6 | #%stop: 30 | ||
7 | |||
8 | #deps | ||
9 | #%needs: | ||
10 | #%before: | ||
11 | #%after: | ||
12 | |||
13 | source /etc/sysconfig/rc | ||
14 | source $rc_functions | ||
15 | |||
16 | gen_keys() { | ||
17 | if [ ! -e /etc/ssh/ssh_host_key ] | ||
18 | then | ||
19 | echo -e ${COLOREDSTAR}"Generating SSH-Hostkey ..." | ||
20 | /usr/bin/ssh-keygen -t rsa1 -b 1024 -f /etc/ssh/ssh_host_key -N '' | ||
21 | fi | ||
22 | |||
23 | if [ ! -e /etc/ssh/ssh_host_dsa_key ] | ||
24 | then | ||
25 | echo -e ${COLREDSTAR}"Generating DSA-Hostkey ..." | ||
26 | /usr/bin/ssh-keygen -d -f /etc/ssh/ssh_host_dsa_key -N '' | ||
27 | fi | ||
28 | |||
29 | if [ ! -e /etc/ssh/ssh_host_rsa_key ] | ||
30 | then | ||
31 | echo -e ${COLOREDSTAR}"Generating RSA-Hostkey ..." | ||
32 | /usr/bin/ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N '' | ||
33 | fi | ||
34 | } | ||
35 | |||
36 | case "$1" in | ||
37 | start) | ||
38 | gen_keys | ||
39 | echo -e ${COLOREDSTAR}"Starting SSH Server ..." | ||
40 | start-stop-daemon --start --quiet --pidfile /var/run/sshd.pid \ | ||
41 | --startas /usr/sbin/sshd | ||
42 | evaluate_retval | ||
43 | |||
44 | update_svcstatus $1 | ||
45 | splash svc_started "$(basename $0)" 0 | ||
46 | ;; | ||
47 | |||
48 | stop) | ||
49 | echo -e ${COLOREDSTAR}"Stopping SSH Server ..." | ||
50 | start-stop-daemon --stop --quiet --pidfile /var/run/sshd.pid | ||
51 | evaluate_retval | ||
52 | |||
53 | update_svcstatus $1 | ||
54 | splash svc_stopped "$(basename $0)" 0 | ||
55 | ;; | ||
56 | |||
57 | reload) | ||
58 | echo -e ${COLOREDSTAR}"Reloading SSH Server ..." | ||
59 | reloadproc /usr/sbin/sshd | ||
60 | ;; | ||
61 | |||
62 | restart) | ||
63 | $0 stop | ||
64 | sleep 1 | ||
65 | $0 start | ||
66 | ;; | ||
67 | |||
68 | status) | ||
69 | statusproc /usr/sbin/sshd | ||
70 | ;; | ||
71 | |||
72 | *) | ||
73 | echo "Usage: $0 {start|stop|reload|restart|status}" | ||
74 | exit 1 | ||
75 | ;; | ||
76 | esac |
Properties
Name | Value |
---|---|
svn:executable | * |