aboutsummaryrefslogtreecommitdiff
path: root/etc/network.subr
diff options
context:
space:
mode:
authorDag-Erling Smørgrav <des@FreeBSD.org>2002-03-19 03:45:02 +0000
committerDag-Erling Smørgrav <des@FreeBSD.org>2002-03-19 03:45:02 +0000
commitdde1888c4acd54bf2a34b758fb59374e4ef89a73 (patch)
treefb406cba80cfbc3725340d39b6a6794b3115a953 /etc/network.subr
parent0e3c27aef0c54b1b8d1175eaaa7df6592607388f (diff)
downloadsrc-dde1888c4acd54bf2a34b758fb59374e4ef89a73.tar.gz
src-dde1888c4acd54bf2a34b758fb59374e4ef89a73.zip
Don't try to generate ssh keys if ssh isn't installed.
Notes
Notes: svn path=/head/; revision=92638
Diffstat (limited to 'etc/network.subr')
-rw-r--r--etc/network.subr18
1 files changed, 11 insertions, 7 deletions
diff --git a/etc/network.subr b/etc/network.subr
index 59f53708c59e..eabdd0b07421 100644
--- a/etc/network.subr
+++ b/etc/network.subr
@@ -847,13 +847,17 @@ network_pass3() {
case ${sshd_enable} in
[Yy][Ee][Ss])
- if [ ! -f /etc/ssh/ssh_host_key ]; then
- echo ' creating ssh RSA host key';
- /usr/bin/ssh-keygen -N "" -f /etc/ssh/ssh_host_key
- fi
- if [ ! -f /etc/ssh/ssh_host_dsa_key ]; then
- echo ' creating ssh DSA host key';
- /usr/bin/ssh-keygen -d -N "" -f /etc/ssh/ssh_host_dsa_key
+ if [ -x /usr/bin/ssh-keygen ]; then
+ if [ ! -f /etc/ssh/ssh_host_key ]; then
+ echo ' creating ssh RSA host key';
+ /usr/bin/ssh-keygen -trsa1 -N "" \
+ -f /etc/ssh/ssh_host_key
+ fi
+ if [ ! -f /etc/ssh/ssh_host_dsa_key ]; then
+ echo ' creating ssh DSA host key';
+ /usr/bin/ssh-keygen -tdsa -N "" \
+ -f /etc/ssh/ssh_host_dsa_key
+ fi
fi
;;
esac