|
@@ -10,7 +10,7 @@ else
|
|
|
echo "SSH Key ${KEY_DIR}/${KEY_NAME} not found locally"
|
|
|
echo ">>> Creating it ..."
|
|
|
ssh-keygen -t ed25519 -f "${KEY_DIR}/${KEY_NAME}" -C "OVH_${KEY_NAME}" -q -N ""
|
|
|
- ./delSSHKey "${KEY_NAME}"
|
|
|
+ delSSHKey "${KEY_NAME}"
|
|
|
fi
|
|
|
PUBKEY="$( cat "${KEY_DIR}/${KEY_NAME}.pub" )"
|
|
|
|
|
@@ -20,7 +20,7 @@ remote_keyname=$( ovhcli get "me/sshKey" | jq --arg v "${KEY_NAME}" -r '.|to_ent
|
|
|
|
|
|
# if remote_keyname exists check if pubkey is matching.
|
|
|
remote_pubkey=$( ovhcli get "me/sshKey/${KEY_NAME}" | jq -r '.key' )
|
|
|
-
|
|
|
+
|
|
|
# if remote_keyname does not match KEY_NAME = this KEY_NAME is not already uploaded into OVH Account
|
|
|
if [ -z "${remote_keyname}" ] || [ "${remote_pubkey}" != "${PUBKEY}" ] ; then
|
|
|
echo "SSH Keys does not exists remotely"
|
|
@@ -33,4 +33,4 @@ else
|
|
|
echo "SSH Keys are up-to-date"
|
|
|
fi
|
|
|
|
|
|
-exit $?
|
|
|
+exit $?
|