diff options
author | Damien Miller <djm@mindrot.org> | 2001-09-15 21:03:10 +1000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2001-09-15 21:03:10 +1000 |
commit | ba6f9f9e492705d85001426d535bd3ff5b8dc46c (patch) | |
tree | 7e58ced6c2ba59af50825d5f0e40dd60f337f960 /contrib | |
parent | 0c217b74e2f6aa89b5961f617c9f5c1fac34873e (diff) | |
download | openssh-git-ba6f9f9e492705d85001426d535bd3ff5b8dc46c.tar.gz |
- (djm) Redhat initscript config sanity checking from Pekka Savola
<pekkas@netcore.fi>
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=$? |