Skip to content

Instantly share code, notes, and snippets.

@dch
Forked from audy/update-ip.sh
Created January 18, 2016 07:25
Show Gist options
  • Save dch/194a144ee26628e71065 to your computer and use it in GitHub Desktop.
Save dch/194a144ee26628e71065 to your computer and use it in GitHub Desktop.
#!/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 "harekrishna@gmail.com:`pass iwantmyname`" \
"https://iwantmyname.com/basicauth/ddns?hostname=${hostname}&myip=${ip6}"
curl \
--user "harekrishna@gmail.com:`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