summaryrefslogtreecommitdiff
path: root/contrib/redhat/sshd.init
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/redhat/sshd.init')
-rwxr-xr-xcontrib/redhat/sshd.init12
1 files changed, 12 insertions, 0 deletions
diff --git a/contrib/redhat/sshd.init b/contrib/redhat/sshd.init
index efedbfb85..86b040cda 100755
--- a/contrib/redhat/sshd.init
+++ b/contrib/redhat/sshd.init
@@ -96,6 +96,16 @@ do_dsa_keygen() {
96 fi 96 fi
97 fi 97 fi
98} 98}
99do_restart_sanity_check() {
100 sshd -t
101 RETVAL=$?
102 if [ ! "$RETVAL" = 0 ]; then
103 my_failure "Configuration file or keys"
104 echo
105 exit $RETVAL
106 fi
107}
108
99 109
100case "$1" in 110case "$1" in
101 start) 111 start)
@@ -127,12 +137,14 @@ case "$1" in
127 echo 137 echo
128 ;; 138 ;;
129 restart) 139 restart)
140 do_restart_sanity_check
130 $0 stop 141 $0 stop
131 $0 start 142 $0 start
132 RETVAL=$? 143 RETVAL=$?
133 ;; 144 ;;
134 condrestart) 145 condrestart)
135 if [ -f /var/lock/subsys/sshd ] ; then 146 if [ -f /var/lock/subsys/sshd ] ; then
147 do_restart_sanity_check
136 $0 stop 148 $0 stop
137 $0 start 149 $0 start
138 RETVAL=$? 150 RETVAL=$?