summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2012-09-04 21:56:16 +0000
committerdes <des@FreeBSD.org>2012-09-04 21:56:16 +0000
commit82e7e4bb59e701ce3230d4695b418db54d025629 (patch)
treed88ab336eb02da4230f47e3c51fb854c36de716c /etc
parent30fc7390d1180dd90e5de1aa42afd3401f8ed46b (diff)
downloadFreeBSD-src-82e7e4bb59e701ce3230d4695b418db54d025629.zip
FreeBSD-src-82e7e4bb59e701ce3230d4695b418db54d025629.tar.gz
Add a configtest command.
Submitted by: gjb@ MFC after: 1 week
Diffstat (limited to 'etc')
-rwxr-xr-xetc/rc.d/sshd10
1 files changed, 9 insertions, 1 deletions
diff --git a/etc/rc.d/sshd b/etc/rc.d/sshd
index a99083c..a932159 100755
--- a/etc/rc.d/sshd
+++ b/etc/rc.d/sshd
@@ -14,8 +14,9 @@ rcvar="sshd_enable"
command="/usr/sbin/${name}"
keygen_cmd="sshd_keygen"
start_precmd="sshd_precmd"
+configtest_cmd="sshd_configtest"
pidfile="/var/run/${name}.pid"
-extra_commands="keygen reload"
+extra_commands="configtest keygen reload"
timeout=300
@@ -87,6 +88,12 @@ sshd_keygen()
)
}
+sshd_configtest()
+{
+ echo "Performing sanity check on ${name} configuration."
+ eval ${command} ${sshd_flags} -t
+}
+
sshd_precmd()
{
if [ ! -f /etc/ssh/ssh_host_key -o \
@@ -96,6 +103,7 @@ sshd_precmd()
user_reseed
run_rc_command keygen
fi
+ sshd_configtest
}
load_rc_config $name
OpenPOWER on IntegriCloud