diff options
Diffstat (limited to 'contrib')
-rwxr-xr-x | contrib/redhat/sshd.init | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/contrib/redhat/sshd.init b/contrib/redhat/sshd.init index efedbfb8..86b040cd 100755 --- a/contrib/redhat/sshd.init +++ b/contrib/redhat/sshd.init @@ -96,6 +96,16 @@ do_dsa_keygen() { fi fi } +do_restart_sanity_check() { + sshd -t + RETVAL=$? + if [ ! "$RETVAL" = 0 ]; then + my_failure "Configuration file or keys" + echo + exit $RETVAL + fi +} + case "$1" in start) @@ -127,12 +137,14 @@ case "$1" in echo ;; restart) + do_restart_sanity_check $0 stop $0 start RETVAL=$? ;; condrestart) if [ -f /var/lock/subsys/sshd ] ; then + do_restart_sanity_check $0 stop $0 start RETVAL=$? |