Skip to content

Instantly share code, notes, and snippets.

@audy
Created January 12, 2016 05:42
Show Gist options
  • Save audy/67a99a0a826e3c2b5cc4 to your computer and use it in GitHub Desktop.
Save audy/67a99a0a826e3c2b5cc4 to your computer and use it in GitHub Desktop.
#!/bin/bash
set -euo pipefail
hostname="test.austinfanclub.com"
ip=`curl http://ipv6.icanhazip.com/`
curl \
--user "[email protected]:`pass iwantmyname`" \
"https://iwantmyname.com/basicauth/ddns?hostname=${hostname}&myip=${ip}"
@dch
Copy link

dch commented Jan 12, 2016

#!/bin/bash
set -euo pipefail
hostname="test.austinfanclub.com"
# use -s6 and -s4 to ensure that a failed curl causes the script to bail correctly
ip6=`curl -s6 http://ipv6.icanhazip.com/`
ip4=`curl -s4 http://ipv4.icanhazip.com/`
curl \
  --user "[email protected]:`pass iwantmyname`" \
  "https://iwantmyname.com/basicauth/ddns?hostname=${hostname}&myip=${ip6}"
curl \
  --user "[email protected]:`pass iwantmyname`" \
  "https://iwantmyname.com/basicauth/ddns?hostname=${hostname}&myip=${ip4}"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment