]> andersk Git - openssh.git/blobdiff - contrib/redhat/sshd.init
- (djm) Update RPM spec file versions
[openssh.git] / contrib / redhat / sshd.init
index c9c1c7bfe5f79ea856a57584b14ad8778695924e..86b040cda0e1588dd14c117abf0aa4b15145d1fc 100755 (executable)
@@ -15,6 +15,8 @@
 # source function library
 . /etc/rc.d/init.d/functions
 
+[ -f /etc/sysconfig/sshd ] && . /etc/sysconfig/sshd
+
 RETVAL=0
 
 # Some functions to make the below more readable
@@ -94,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)
@@ -104,7 +116,7 @@ case "$1" in
                
                echo -n "Starting sshd: "
                if [ ! -f $PID_FILE ] ; then
-                       sshd
+                       sshd $OPTIONS
                        RETVAL=$?
                        if [ "$RETVAL" = "0" ] ; then
                                my_success "sshd startup" "sshd"
@@ -125,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=$?
This page took 0.053105 seconds and 4 git commands to generate.