getSecret 424 B

123456789101112
  1. #!/bin/bash
  2. # get Email Secret ID :
  3. last_id=$( ./ovh-bash get me/notification/email/history | jq 'last(.[])' )
  4. secret_id=$( ./ovh-bash get me/notification/email/history/${last_id} | jq -r '.body' | awk '/secret/ { split($NF,a,"=") ; print a[2] }' )
  5. # retrieve or set Password from email link
  6. vps_password=$( ./ovh-bash post secret/retrieve '{ "id": "'${secret_id}'" }' | jq -r '.secret' )
  7. echo "${vps_password}"
  8. exit $?