From ba6f9f9e492705d85001426d535bd3ff5b8dc46c Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Sat, 15 Sep 2001 21:03:10 +1000 Subject: - (djm) Redhat initscript config sanity checking from Pekka Savola --- contrib/redhat/sshd.init | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'contrib') 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=$? -- cgit v1.2.1