12345678910111213 |
- #!/bin/bash
- SRV="${1:?Need a fqdn}"
- SSHKEY_NAME="lfwdbot"
- #HTTP_PAYLOAD='{ "doNotSendPassword": false, "language": "fr", "publicSshKey": "", "softwareId": [0], "sshKey": [ "'${SSHKEY_NAME}'" ], "templateId": 0 }'
- sshpubkey=$( ./getSSHKeys "${SSHKEY_NAME}" | jq -r '.key' )
- image_id=$( ./getImageDetails "${SRV}" | jq -r '.id' )
- HTTP_PAYLOAD='{ "doNotSendPassword": true, "publicSshKey": "'${sshpubkey}'", "imageId": "'${image_id}'" }'
- ./ovh-bash post "vps/${SRV}/rebuild" "${HTTP_PAYLOAD}"
- exit $?
|