Skip to content

Instantly share code, notes, and snippets.

@SwamiRama
Created July 7, 2017 20:20
Show Gist options
  • Save SwamiRama/16cce348892ff4af56cb5ac583c435d6 to your computer and use it in GitHub Desktop.
Save SwamiRama/16cce348892ff4af56cb5ac583c435d6 to your computer and use it in GitHub Desktop.
IP = `curl ipinfo.io/ip`.delete!("\n")
puts IP
curl_command = "curl -X PUT \"https://api.cloudflare.com/client/v4/zones/ZONEINFO/dns_records/DOMAIN_INFO\" \
-H \"X-Auth-Email: EMAIL\" \
-H \"X-Auth-Key: API_KEY\" \
-H \"Content-Type: application/json\" \
--data '{\"type\":\"A\",\"name\":\"domain\",\"content\":\"#{IP}\",\"proxied\":true}'\"\""
exec curl_command
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment