Last active
August 31, 2016 18:43
-
-
Save cemk/ec920ff2eefe00f3adc6b22cb6ca5613 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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