summaryrefslogtreecommitdiff
path: root/contrib/redhat/sshd.init
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/sshd.init
parent0c217b74e2f6aa89b5961f617c9f5c1fac34873e (diff)
- (djm) Redhat initscript config sanity checking from Pekka Savola
<pekkas@netcore.fi>
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=$?