Magellan Linux

Annotation of /trunk/magellan-initscripts/etc/rc.d/init.d/sshd

Parent Directory Parent Directory | Revision Log Revision Log


Revision 71 - (hide annotations) (download)
Tue Mar 15 19:07:56 2005 UTC (19 years, 2 months ago) by niro
File size: 1491 byte(s)
updated header and fixed whitespaces

1 niro 2 #!/bin/bash
2 niro 71 # $Header: /home/cvsd/magellan-cvs/magellan-src/magellan-initscripts/etc/rc.d/init.d/sshd,v 1.3 2005-03-15 19:07:56 niro Exp $
3 niro 2
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 niro 21
23 niro 2 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 niro 21
29 niro 2 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 niro 21 start-stop-daemon --start --quiet --pidfile /var/run/sshd.pid \
41     --startas /usr/sbin/sshd
42 niro 2 update_svcstatus $1
43     splash svc_started "$(basename $0)" 0
44     ;;
45    
46     stop)
47     echo -e ${COLOREDSTAR}"Stopping SSH Server ..."
48 niro 21 start-stop-daemon --stop --quiet --pidfile /var/run/sshd.pid
49 niro 2
50     update_svcstatus $1
51     splash svc_stopped "$(basename $0)" 0
52     ;;
53    
54     reload)
55     echo -e ${COLOREDSTAR}"Reloading SSH Server ..."
56     reloadproc /usr/sbin/sshd
57     ;;
58    
59     restart)
60     $0 stop
61     sleep 1
62     $0 start
63     ;;
64 niro 21
65 niro 2 status)
66     statusproc /usr/sbin/sshd
67     ;;
68 niro 21
69 niro 2 *)
70     echo "Usage: $0 {start|stop|reload|restart|status}"
71     exit 1
72 niro 21 ;;
73 niro 2 esac

Properties

Name Value
svn:executable *