Magellan Linux

Annotation of /branches/unlabeled-1.1.1/magellan-initscripts/etc/rc.d/init.d/sshd

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2 - (hide annotations) (download)
Mon Dec 13 22:52:07 2004 UTC (19 years, 4 months ago) by niro
File size: 1261 byte(s)
imported.

1 niro 2 #!/bin/bash
2    
3     #%rlevels: 3:s 4:s 5:s 0:k 1:k 2:k 6:k
4     #%start: 30
5     #%stop: 30
6    
7     #deps
8     #%needs:
9     #%before:
10     #%after:
11    
12     source /etc/sysconfig/rc
13     source $rc_functions
14    
15     gen_keys() {
16     if [ ! -e /etc/ssh/ssh_host_key ]
17     then
18     echo -e ${COLOREDSTAR}"Generating SSH-Hostkey ..."
19     /usr/bin/ssh-keygen -t rsa1 -b 1024 -f /etc/ssh/ssh_host_key -N ''
20     fi
21    
22     if [ ! -e /etc/ssh/ssh_host_dsa_key ]
23     then
24     echo -e ${COLREDSTAR}"Generating DSA-Hostkey ..."
25     /usr/bin/ssh-keygen -d -f /etc/ssh/ssh_host_dsa_key -N ''
26     fi
27    
28     if [ ! -e /etc/ssh/ssh_host_rsa_key ]
29     then
30     echo -e ${COLOREDSTAR}"Generating RSA-Hostkey ..."
31     /usr/bin/ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N ''
32     fi
33     }
34    
35     case "$1" in
36     start)
37     gen_keys
38     echo -e ${COLOREDSTAR}"Starting SSH Server ..."
39     loadproc /usr/sbin/sshd
40    
41     update_svcstatus $1
42     splash svc_started "$(basename $0)" 0
43     ;;
44    
45     stop)
46     echo -e ${COLOREDSTAR}"Stopping SSH Server ..."
47     killproc /usr/sbin/sshd
48    
49     update_svcstatus $1
50     splash svc_stopped "$(basename $0)" 0
51     ;;
52    
53     reload)
54     echo -e ${COLOREDSTAR}"Reloading SSH Server ..."
55     reloadproc /usr/sbin/sshd
56     ;;
57    
58     restart)
59     $0 stop
60     sleep 1
61     $0 start
62     ;;
63     status)
64     statusproc /usr/sbin/sshd
65     ;;
66     *)
67     echo "Usage: $0 {start|stop|reload|restart|status}"
68     exit 1
69     ;;
70     esac

Properties

Name Value
svn:executable *