Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3 by niro, Mon Dec 13 22:52:07 2004 UTC revision 71 by niro, Tue Mar 15 19:07:56 2005 UTC
# Line 1  Line 1 
1  #!/bin/bash  #!/bin/bash
2    # $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    
4  #%rlevels: 3:s 4:s 5:s 0:k 1:k 2:k 6:k  #%rlevels: 3:s 4:s 5:s 0:k 1:k 2:k 6:k
5  #%start: 30  #%start: 30
# Line 18  gen_keys() { Line 19  gen_keys() {
19   echo -e ${COLOREDSTAR}"Generating SSH-Hostkey ..."   echo -e ${COLOREDSTAR}"Generating SSH-Hostkey ..."
20   /usr/bin/ssh-keygen -t rsa1 -b 1024 -f /etc/ssh/ssh_host_key -N ''   /usr/bin/ssh-keygen -t rsa1 -b 1024 -f /etc/ssh/ssh_host_key -N ''
21   fi   fi
22    
23   if [ ! -e /etc/ssh/ssh_host_dsa_key ]   if [ ! -e /etc/ssh/ssh_host_dsa_key ]
24   then   then
25   echo -e ${COLREDSTAR}"Generating DSA-Hostkey ..."   echo -e ${COLREDSTAR}"Generating DSA-Hostkey ..."
26   /usr/bin/ssh-keygen -d -f /etc/ssh/ssh_host_dsa_key -N ''   /usr/bin/ssh-keygen -d -f /etc/ssh/ssh_host_dsa_key -N ''
27   fi   fi
28    
29   if [ ! -e /etc/ssh/ssh_host_rsa_key ]   if [ ! -e /etc/ssh/ssh_host_rsa_key ]
30   then   then
31   echo -e ${COLOREDSTAR}"Generating RSA-Hostkey ..."   echo -e ${COLOREDSTAR}"Generating RSA-Hostkey ..."
# Line 36  case "$1" in Line 37  case "$1" in
37   start)   start)
38   gen_keys   gen_keys
39   echo -e ${COLOREDSTAR}"Starting SSH Server ..."   echo -e ${COLOREDSTAR}"Starting SSH Server ..."
40   loadproc /usr/sbin/sshd   start-stop-daemon --start --quiet --pidfile /var/run/sshd.pid \
41     --startas /usr/sbin/sshd
42   update_svcstatus $1   update_svcstatus $1
43   splash svc_started "$(basename $0)" 0   splash svc_started "$(basename $0)" 0
44   ;;   ;;
45    
46   stop)   stop)
47   echo -e ${COLOREDSTAR}"Stopping SSH Server ..."   echo -e ${COLOREDSTAR}"Stopping SSH Server ..."
48   killproc /usr/sbin/sshd   start-stop-daemon --stop --quiet --pidfile /var/run/sshd.pid
49    
50   update_svcstatus $1   update_svcstatus $1
51   splash svc_stopped "$(basename $0)" 0   splash svc_stopped "$(basename $0)" 0
# Line 60  case "$1" in Line 61  case "$1" in
61   sleep 1   sleep 1
62   $0 start   $0 start
63   ;;   ;;
64    
65   status)   status)
66   statusproc /usr/sbin/sshd   statusproc /usr/sbin/sshd
67   ;;   ;;
68    
69   *)   *)
70   echo "Usage: $0 {start|stop|reload|restart|status}"   echo "Usage: $0 {start|stop|reload|restart|status}"
71   exit 1   exit 1
72   ;;   ;;
73  esac  esac

Legend:
Removed from v.3  
changed lines
  Added in v.71