Created
August 7, 2020 09:13
-
-
Save jparrill/e71f869570a5e798879f07e0c931170f to your computer and use it in GitHub Desktop.
google-ddns-domain-update Script
This file contains hidden or 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 | |
| USERNAME="" | |
| PASSWORD="" | |
| HOSTNAME="yoursubdomain.yourdomain.here" | |
| # Resolve current public IP | |
| IP=$(curl -s "https://domains.google.com/checkip") | |
| # Update Google DNS Record | |
| URL="https://${USERNAME}:${PASSWORD}@domains.google.com/nic/update?hostname=${HOSTNAME}&myip=${IP}" | |
| curl -s $URL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment