Skip to content

Instantly share code, notes, and snippets.

@solibres
Forked from pedrom34/asuswrt-ovh-ddns.sh
Created June 21, 2022 22:15
Show Gist options
  • Select an option

  • Save solibres/c1b647046f11a780b099218a6cc17ce7 to your computer and use it in GitHub Desktop.

Select an option

Save solibres/c1b647046f11a780b099218a6cc17ce7 to your computer and use it in GitHub Desktop.

Revisions

  1. @pedrom34 pedrom34 revised this gist Apr 10, 2018. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions asuswrt-ovh-ddns.sh
    Original file line number Diff line number Diff line change
    @@ -4,6 +4,9 @@
    # 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
    #
    # Forked from
    # https://gist.github.com/atais/9ea6595072096ab8077f619bd3648da8
    ###

    set -u
  2. @pedrom34 pedrom34 revised this gist Mar 29, 2018. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions asuswrt-ovh-ddns.sh
    Original file line number Diff line number Diff line change
    @@ -10,7 +10,7 @@ set -u

    U=user
    P=password
    H=host
    H=domain

    # args: username password hostname ip
    ovh_dns_update() {
    @@ -24,7 +24,7 @@ ovh_dns_update() {

    ### When double NATed behind ISP's router this line gets IP from outside, otherwise, comment out next line.
    IP=$(wget -O - -q http://myip.dnsomatic.com/)
    # last parameter is IP, use $1 or $IP
    ovh_dns_update $U $P $H $1
    # last parameter is IP, use $IP
    ovh_dns_update $U $P $H $IP

    exit 0
  3. Pierre revised this gist Dec 22, 2017. 1 changed file with 5 additions and 5 deletions.
    10 changes: 5 additions & 5 deletions asuswrt-ovh-ddns.sh
    Original file line number Diff line number Diff line change
    @@ -8,9 +8,9 @@

    set -u

    U=xxxx
    P=xxxx
    H=xxxx
    U=user
    P=password
    H=host

    # args: username password hostname ip
    ovh_dns_update() {
    @@ -22,8 +22,8 @@ ovh_dns_update() {
    esac
    }

    ### you can obtain your external IP with this API
    # IP=$(curl -s ifconfig.co)
    ### When double NATed behind ISP's router this line gets IP from outside, otherwise, comment out next line.
    IP=$(wget -O - -q http://myip.dnsomatic.com/)
    # last parameter is IP, use $1 or $IP
    ovh_dns_update $U $P $H $1

  4. @atais atais revised this gist Oct 18, 2017. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions asuswrt-ovh-ddns.sh
    Original file line number Diff line number Diff line change
    @@ -24,6 +24,7 @@ ovh_dns_update() {

    ### you can obtain your external IP with this API
    # IP=$(curl -s ifconfig.co)
    # last parameter is IP, use $1 or $IP
    ovh_dns_update $U $P $H $1

    exit 0
  5. @atais atais revised this gist Feb 13, 2017. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions asuswrt-ovh-ddns.sh
    Original file line number Diff line number Diff line change
    @@ -22,6 +22,8 @@ ovh_dns_update() {
    esac
    }

    ### you can obtain your external IP with this API
    # IP=$(curl -s ifconfig.co)
    ovh_dns_update $U $P $H $1

    exit 0
  6. @atais atais revised this gist Feb 13, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion asuswrt-ovh-ddns.sh
    Original file line number Diff line number Diff line change
    @@ -14,7 +14,7 @@ H=xxxx

    # args: username password hostname ip
    ovh_dns_update() {
    CMD=$(curl -s -u $1:$2 https://www.ovh.com/nic/update?system=dyndns&hostname=$3&myip=$4)
    CMD=$(curl -s -u $1:$2 "https://www.ovh.com/nic/update?system=dyndns&hostname=$3&myip=$4")
    logger "ovh-ddns-updated: $CMD"
    case "$CMD" in
    good*|nochg*) /sbin/ddns_custom_updated 1 ;;
  7. @atais atais created this gist Feb 13, 2017.
    27 changes: 27 additions & 0 deletions asuswrt-ovh-ddns.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,27 @@
    #!/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=xxxx
    P=xxxx
    H=xxxx

    # args: username password hostname ip
    ovh_dns_update() {
    CMD=$(curl -s -u $1:$2 https://www.ovh.com/nic/update?system=dyndns&hostname=$3&myip=$4)
    logger "ovh-ddns-updated: $CMD"
    case "$CMD" in
    good*|nochg*) /sbin/ddns_custom_updated 1 ;;
    *) /sbin/ddns_custom_updated 0 ;;
    esac
    }

    ovh_dns_update $U $P $H $1

    exit 0