diff --git a/kvm-install-vm b/kvm-install-vm index 83b880c..86bf56d 100755 --- a/kvm-install-vm +++ b/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