]> git.pld-linux.org Git - packages/openssh.git/blobdiff - opensshd.init
- unify msg_not_running usage
[packages/openssh.git] / opensshd.init
index 64bc8f7b7c01f59c4e4a89475844e5077fcb1b26..baf7c33db57f2901cc649557057faa1aad06bcfb 100644 (file)
@@ -28,6 +28,10 @@ else
        exit 0
 fi
 
+checkconfig() {
+       /usr/sbin/sshd -t || exit 1
+}
+
 RETVAL=0
 # See how we were called.
 case "$1" in
@@ -49,6 +53,8 @@ case "$1" in
                [ -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 @@ case "$1" in
        fi
        ;;
   restart)
+       checkconfig
        $0 stop
        $0 start
        exit $?
@@ -107,7 +114,7 @@ case "$1" in
                killproc sshd -HUP
                RETVAL=$?
        else
-               msg_not_running OpenSSH >&2
+               msg_not_running OpenSSH
                exit 7
        fi
        ;;
This page took 0.08434 seconds and 4 git commands to generate.