Changed SSH key save name to include id_keytype to be more standard 😎

This commit is contained in:
Price Hiller 2021-10-06 00:17:18 -05:00
parent 1e565a741d
commit a1f1c99cbc

View File

@ -253,7 +253,7 @@ SSH_KEY_DIRECTORY="${HOME}/.ssh/keys/${ssh_host_name}/"
log "info" "Creating directory ${SSH_KEY_DIRECTORY} for the ssh key if it doesn't exist"
mkdir -p "${SSH_KEY_DIRECTORY}" > /dev/null
SSH_KEY_FILE="${SSH_KEY_DIRECTORY}/${ssh_user_to_create}-${ssh_key_type}"
SSH_KEY_FILE="${SSH_KEY_DIRECTORY}/${ssh_user_to_create}-id_${ssh_key_type}"
[[ -f "${SSH_KEY_FILE}" ]] &&
log "error" "${SSH_KEY_FILE} already exists! This may lead to major errors, check your SSH configuration and remove the SSH entry as well as the SSH key file or create a different user if you wish to continue." &&