summaryrefslogtreecommitdiff
path: root/contrib/redhat/sshd.init
diff options
context:
space:
mode:
authorBen Lindstrom <mouring@eviladmin.org>2001-02-26 20:38:53 +0000
committerBen Lindstrom <mouring@eviladmin.org>2001-02-26 20:38:53 +0000
commit0c100870ac1c271a0a3d65099777af312e71d865 (patch)
tree3259fad4d7103dc544b2419339ba6f86eb189703 /contrib/redhat/sshd.init
parent7603b2d244c9aeacacc78b246594bea011c48bd7 (diff)
- (bal) sshd.init support for all Redhat release. Patch by Jim Knoble
<jmknoble@jmknoble.cx>
Diffstat (limited to 'contrib/redhat/sshd.init')
-rwxr-xr-xcontrib/redhat/sshd.init48
1 files changed, 40 insertions, 8 deletions
diff --git a/contrib/redhat/sshd.init b/contrib/redhat/sshd.init
index a4df64276..c9c1c7bfe 100755
--- a/contrib/redhat/sshd.init
+++ b/contrib/redhat/sshd.init
@@ -23,14 +23,46 @@ RSA1_KEY=/etc/ssh/ssh_host_key
23RSA_KEY=/etc/ssh/ssh_host_rsa_key 23RSA_KEY=/etc/ssh/ssh_host_rsa_key
24DSA_KEY=/etc/ssh/ssh_host_dsa_key 24DSA_KEY=/etc/ssh/ssh_host_dsa_key
25PID_FILE=/var/run/sshd.pid 25PID_FILE=/var/run/sshd.pid
26my_success() {
27 local msg
28 if [ $# -gt 1 ]; then
29 msg="$2"
30 else
31 msg="done"
32 fi
33 case "`type -type success`" in
34 function)
35 success "$1"
36 ;;
37 *)
38 echo -n "${msg}"
39 ;;
40 esac
41}
42my_failure() {
43 local msg
44 if [ $# -gt 1 ]; then
45 msg="$2"
46 else
47 msg="FAILED"
48 fi
49 case "`type -type failure`" in
50 function)
51 failure "$1"
52 ;;
53 *)
54 echo -n "${msg}"
55 ;;
56 esac
57}
26do_rsa1_keygen() { 58do_rsa1_keygen() {
27 if ! test -f $RSA1_KEY ; then 59 if ! test -f $RSA1_KEY ; then
28 echo -n "Generating SSH1 RSA host key: " 60 echo -n "Generating SSH1 RSA host key: "
29 if $KEYGEN -q -t rsa1 -f $RSA1_KEY -C '' -N '' >&/dev/null; then 61 if $KEYGEN -q -t rsa1 -f $RSA1_KEY -C '' -N '' >&/dev/null; then
30 success "RSA1 key generation" 62 my_success "RSA1 key generation"
31 echo 63 echo
32 else 64 else
33 failure "RSA1 key generation" 65 my_failure "RSA1 key generation"
34 echo 66 echo
35 exit 1 67 exit 1
36 fi 68 fi
@@ -40,10 +72,10 @@ do_rsa_keygen() {
40 if ! test -f $RSA_KEY ; then 72 if ! test -f $RSA_KEY ; then
41 echo -n "Generating SSH2 RSA host key: " 73 echo -n "Generating SSH2 RSA host key: "
42 if $KEYGEN -q -t rsa -f $RSA_KEY -C '' -N '' >&/dev/null; then 74 if $KEYGEN -q -t rsa -f $RSA_KEY -C '' -N '' >&/dev/null; then
43 success "RSA key generation" 75 my_success "RSA key generation"
44 echo 76 echo
45 else 77 else
46 failure "RSA key generation" 78 my_failure "RSA key generation"
47 echo 79 echo
48 exit 1 80 exit 1
49 fi 81 fi
@@ -53,10 +85,10 @@ do_dsa_keygen() {
53 if ! test -f $DSA_KEY ; then 85 if ! test -f $DSA_KEY ; then
54 echo -n "Generating SSH2 DSA host key: " 86 echo -n "Generating SSH2 DSA host key: "
55 if $KEYGEN -q -t dsa -f $DSA_KEY -C '' -N '' >&/dev/null; then 87 if $KEYGEN -q -t dsa -f $DSA_KEY -C '' -N '' >&/dev/null; then
56 success "DSA key generation" 88 my_success "DSA key generation"
57 echo 89 echo
58 else 90 else
59 failure "DSA key generation" 91 my_failure "DSA key generation"
60 echo 92 echo
61 exit 1 93 exit 1
62 fi 94 fi
@@ -75,10 +107,10 @@ case "$1" in
75 sshd 107 sshd
76 RETVAL=$? 108 RETVAL=$?
77 if [ "$RETVAL" = "0" ] ; then 109 if [ "$RETVAL" = "0" ] ; then
78 success "sshd startup" 110 my_success "sshd startup" "sshd"
79 touch /var/lock/subsys/sshd 111 touch /var/lock/subsys/sshd
80 else 112 else
81 failure "sshd startup" 113 my_failure "sshd startup" ""
82 fi 114 fi
83 fi 115 fi
84 echo 116 echo