Created
December 22, 2018 16:04
-
-
Save g3rd/5f51dddc11a12ac654eaa8111391ce06 to your computer and use it in GitHub Desktop.
CloudFlare transfer domains
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Get here: https://support.cloudflare.com/hc/en-us/articles/200167836-Where-do-I-find-my-Cloudflare-API-key- | |
export CF_API_EMAIL=you@example.com | |
export CF_API_KEY=abc123def456ghi789 | |
# Grabbed mine out of the dashboard url | |
export CF_ACCOUNT_ID=abc123def456ghi789 | |
for domain in $(cat domains.txt); do \ | |
curl -X POST -H "X-Auth-Key: $CF_API_KEY" -H "X-Auth-Email: $CF_API_EMAIL" \ | |
-H "Content-Type: application/json" \ | |
"https://api.cloudflare.com/client/v4/zones" \ | |
--data '{"account": {"id": "'$CF_ACCOUNT_ID'"}, "name":"'$domain'","jump_start":true}'; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment