#!/bin/sh set -eu if [ -z "$OVH_APP_KEY" ]; then echo 'Need $OVH_APP_KEY!' echo "https://eu.api.ovh.com/createApp/" exit 1 fi BODY=' { "accessRules": [ { "method": "DELETE", "path": "/domain/zone/*" }, { "method": "GET", "path": "/domain/zone/*" }, { "method": "POST", "path": "/domain/zone/*" }, { "method": "PUT", "path": "/domain/zone/*" }, { "method": "GET", "path": "/domain/*" }, { "method": "PUT", "path": "/domain/*" }, { "method": "POST", "path": "/domain/*/nameServers/update" } ] } ' echo $BODY | xh --json --print=b POST https://eu.api.ovh.com/1.0/auth/credential "X-Ovh-Application:$OVH_APP_KEY"