Skip to content

Instantly share code, notes, and snippets.

@cemk
Last active August 31, 2016 18:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cemk/ec920ff2eefe00f3adc6b22cb6ca5613 to your computer and use it in GitHub Desktop.
Save cemk/ec920ff2eefe00f3adc6b22cb6ca5613 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Get your token from DuckDNS.org
TOKEN="YOUR-TOKEN-HERE"
# Your domains as a list.
domains=("DOMAIN1" "DOMAIN2")
# Let the code do its thing.
LOCALIP="$(ifconfig wlan0 | grep "inet addr" | cut -d ':' -f 2 | cut -d ' ' -f 1)"
echo "Local IP: $LOCALIP"
for DOMAIN in "${domains[@]}"
do
curl "https://www.duckdns.org/update?domains=$DOMAIN&token=$TOKEN&ip=$LOCALIP"
echo " $DOMAIN"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment