Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- DomainName=
- Username=
- Password=
- WANInterface=
- CurrWANIP=$(ip -o -4 addr show $WANInterface | awk -F '[ /]+' '{print $4}')
- GDNSIP=$(dig $MyGDomain +short)
- if [ "$CurrWANIP" == "$GDNSIP" ]; then
- logger "Google Domains DDNS: WAN IP ($CurrWANIP) unchanged, no update necessary"
- else
- ipupdate=$(curl -s https://$Username:$Password@domains.google.com/nic/update?hostname=$MyGDomain&myip=$CurrWANIP)
- if [ "$ipupdate" == "good $CurrWANIP" ]; then
- logger "Google Domains DDNS: DNS updated to $CurrWANIP from $GDNSIP"
- else
- logger -s "Google Domains DDNS: Error: $ipupdate"
- fi
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement