Last active
March 25, 2020 09:50
-
-
Save atais/4c2d1b60e4abe997f8c231554d52782d to your computer and use it in GitHub Desktop.
update ddns on OVH
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/sh | |
### | |
# Based on | |
# https://github.com/RMerl/asuswrt-merlin/wiki/Custom-DDNS#google-domains | |
# https://github.com/RMerl/asuswrt-merlin/wiki/Custom-DDNS#bind9-ddns-using-nsupdate | |
### | |
set -u | |
U=USER | |
P=**** | |
IP=$1 | |
# args: username password hostname ip | |
ovh_dns_update() { | |
CMD=$(curl -s -u "$U":"$P" "https://www.ovh.com/nic/update?system=dyndns&hostname=$1&myip=$IP") | |
case "$CMD" in | |
good*|nochg*) echo "Updated $1 to $IP" ;; | |
*) echo "During updating $1 to $IP, error: $CMD" ;; | |
esac | |
} | |
ovh_dns_update domain.pl | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment