From d78f2b4b56c847108a0b2483f117d4dcc6e76ce0 Mon Sep 17 00:00:00 2001 From: David Celis Date: Fri, 24 Jun 2016 16:45:57 -0700 Subject: [PATCH] Add dynamic DNS script for cloudflare Signed-off-by: David Celis --- local/bin/update-cloudflare-dns | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100755 local/bin/update-cloudflare-dns diff --git a/local/bin/update-cloudflare-dns b/local/bin/update-cloudflare-dns new file mode 100755 index 0000000..4f8430d --- /dev/null +++ b/local/bin/update-cloudflare-dns @@ -0,0 +1,9 @@ +#!/bin/bash + +IP=`curl -s http://icanhazip.com/` + +curl -X PUT "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/dns_records/$RECORD_ID" \ + -H "X-Auth-Email: $EMAIL" \ + -H "X-Auth-Key: $CLOUDFLARE_API_KEY" \ + -H "Content-Type: application/json" \ + -d "{\"type\":\"A\",\"name\":\"mbp.davidcel.is\",\"content\":\"$IP\",\"ttl\":120}" -- 2.51.2