diff options
author | Mateusz Piotrowski <0mp@FreeBSD.org> | 2020-04-15 14:07:33 +0000 |
---|---|---|
committer | Mateusz Piotrowski <0mp@FreeBSD.org> | 2020-04-15 14:07:33 +0000 |
commit | 3e586086348e6e0d7af1424510630b9dd5f9404a (patch) | |
tree | 246c0a18e7b0f7d41b4ab65a9d00a8d580ee1a8c /libexec | |
parent | e3637e41e3654cf2207dfa9725cf47d1c19550bf (diff) | |
download | src-3e586086348e6e0d7af1424510630b9dd5f9404a.tar.gz src-3e586086348e6e0d7af1424510630b9dd5f9404a.zip |
Notes
Diffstat (limited to 'libexec')
-rwxr-xr-x | libexec/rc/rc.d/sshd | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/libexec/rc/rc.d/sshd b/libexec/rc/rc.d/sshd index d45963524b3d..282f69f8e4ca 100755 --- a/libexec/rc/rc.d/sshd +++ b/libexec/rc/rc.d/sshd @@ -45,18 +45,19 @@ sshd_keygen_alg() ;; esac + if [ -f "${keyfile}" ] ; then + info "$ALG host key exists." + return 0 + fi + if [ ! -x /usr/bin/ssh-keygen ] ; then warn "/usr/bin/ssh-keygen does not exist." return 1 fi - if [ -f "${keyfile}" ] ; then - info "$ALG host key exists." - else - echo "Generating $ALG host key." - /usr/bin/ssh-keygen -q -t $alg -f "$keyfile" -N "" - /usr/bin/ssh-keygen -l -f "$keyfile.pub" - fi + echo "Generating $ALG host key." + /usr/bin/ssh-keygen -q -t $alg -f "$keyfile" -N "" + /usr/bin/ssh-keygen -l -f "$keyfile.pub" } sshd_keygen() |