Author: glen                         Date: Sun Oct  9 11:52:47 2005 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- check for sshd config validity before starting or restarting

---- Files affected:
SOURCES:
   opensshd.init (1.26 -> 1.27) 

---- Diffs:

================================================================
Index: SOURCES/opensshd.init
diff -u SOURCES/opensshd.init:1.26 SOURCES/opensshd.init:1.27
--- SOURCES/opensshd.init:1.26  Thu Aug 11 22:43:42 2005
+++ SOURCES/opensshd.init       Sun Oct  9 13:52:42 2005
@@ -28,6 +28,10 @@
        exit 0
 fi
 
+checkconfig() {
+       /usr/sbin/sshd -t || exit 1
+}
+
 RETVAL=0
 # See how we were called.
 case "$1" in
@@ -49,6 +53,8 @@
                [ -x /sbin/restorecon ] && /sbin/restorecon 
/etc/ssh/ssh_host_dsa_key || :
        fi
 
+       checkconfig
+
        if [ ! -f /etc/ssh/ssh_host_key ]; then
                msg_not_running OpenSSH
                nls "No SSH host key found! You must run \"%s init\" first." 
"$0"
@@ -78,6 +84,7 @@
        fi
        ;;
   restart)
+       checkconfig
        $0 stop
        $0 start
        exit $?
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SOURCES/opensshd.init?r1=1.26&r2=1.27&f=u

_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to