summaryrefslogtreecommitdiff
path: root/contrib/redhat
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2001-09-15 21:03:10 +1000
committerDamien Miller <djm@mindrot.org>2001-09-15 21:03:10 +1000
commitba6f9f9e492705d85001426d535bd3ff5b8dc46c (patch)
tree7e58ced6c2ba59af50825d5f0e40dd60f337f960 /contrib/redhat
parent0c217b74e2f6aa89b5961f617c9f5c1fac34873e (diff)
- (djm) Redhat initscript config sanity checking from Pekka Savola
<pekkas@netcore.fi>
Diffstat (limited to 'contrib/redhat')
-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 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=$?