Skip to content

Instantly share code, notes, and snippets.

@hamiltont
Forked from mislav/dynamic_dnsimple.sh
Created December 18, 2013 05:38
Show Gist options
  • Save hamiltont/8017755 to your computer and use it in GitHub Desktop.
Save hamiltont/8017755 to your computer and use it in GitHub Desktop.
Using username and password authentication
#!/bin/bash
set -e
domain=mislav.net
record=511770 # mysubdomain.mislav.net
ip="$( curl -s icanhazip.com )"
payload="{ \"record\": { \"content\": \"${ip}\" } }"
curl -fsS --netrc \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-X PUT -d "${payload}" \
"https://dnsimple.com/domains/${domain}/records/${record}"
# part of ~/.netrc
machine dnsimple.com
login mislav.marohnic@gmail.com
password YOUWISH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment