Browse Source

Merge pull request #14 from eklitzke/ssh

If id_rsa.pub doesn't exist, check for id_dsa.pub or id_ed25519.pub
pull/17/head
Giovanni Torres 8 years ago committed by GitHub
parent
commit
4e68e668c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 13
      kvm-install-vm

13
kvm-install-vm

@ -318,6 +318,17 @@ function fetch_images ()
function check_ssh_key ()
{
local key
if [ -z "${PUBKEY}" ]; then
# Try to find a suitable key file.
for key in ~/.ssh/id_{rsa,dsa,ed25519}.pub; do
if [ -f "$key" ]; then
PUBKEY="$key"
break
fi
done
fi
if [ ! -f "${PUBKEY}" ]
then
# Check for existence of a pubkey, or else exit with message
@ -663,7 +674,7 @@ function set_defaults ()
RESIZE_DISK=false # Resize disk (boolean)
IMAGEDIR=${HOME}/virt/images # Directory to store images
BRIDGE=virbr0 # Hypervisor bridge
PUBKEY=${HOME}/.ssh/id_rsa.pub # SSH public key
PUBKEY="" # SSH public key
DISTRO=centos7 # Distribution
MACADDRESS="" # MAC Address
PORT=-1 # Console port

Loading…
Cancel
Save