# 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
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)
echo -n "Starting sshd: "
if [ ! -f $PID_FILE ] ; then
- sshd
+ sshd $OPTIONS
RETVAL=$?
if [ "$RETVAL" = "0" ] ; then
my_success "sshd startup" "sshd"
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=$?