diff --git a/CHANGELOG.md b/CHANGELOG.md index 6bcc095..1b1aed5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ ### New +* :sparkles: add DynDNS2 support for dynv6.com. [Eduard Veit] + * :sparkles: add .gitchangelog.rc. [Eduard Veit] * :sparkles: add dynb. [Eduard Veit] diff --git a/README.md b/README.md index e71e8ef..c533bd8 100644 --- a/README.md +++ b/README.md @@ -18,16 +18,18 @@ The following update methods are currently implemented: ### APIs -* INWX JSON-RPC-API +* INWX.com JSON-RPC-API Limitations: - minimum TTL is 300 (5 minutes) ### DynDNS2 -* INWX DynDNS2 protocol +* INWX.com Limitations: - minimum TTL is 60 (1 minute) - one DynDNS account with one hostname is for free +* dynv6.com + - note: assign your token to the password setting ## 📦 Requirements diff --git a/dynb.sh b/dynb.sh index 780cf4f..5f333aa 100755 --- a/dynb.sh +++ b/dynb.sh @@ -168,22 +168,43 @@ function updateRecord() { # using DynDNS2 protocol function dynupdate() { + myip_str= + myipv6_str= + INWX_DYNDNS_UPDATE_URL="https://dyndns.inwx.com/nic/update?" + DYNV6_DYNDNS_UPDATE_URL="https://dynv6.com/api/update?zone=$_dyn_domain&token=$_password&" + if [[ $_serviceProvider == "inwx" ]]; then dyndns_update_url=$INWX_DYNDNS_UPDATE_URL + myip_str=myip + myipv6_str=myipv6 fi - if [[ $_is_IPv4_enabled == true ]] && [[ $_is_IPv6_enabled == true ]]; then - dyndns_update_url="${dyndns_update_url}myip=${_new_IPv4}&myipv6=${_new_IPv6}" - fi - if [[ $_is_IPv4_enabled == true ]] && [[ $_is_IPv6_enabled == false ]]; then - dyndns_update_url="${dyndns_update_url}myip=${_new_IPv4}" - fi - if [[ $_is_IPv4_enabled == false ]] && [[ $_is_IPv6_enabled == true ]]; then - dyndns_update_url="${dyndns_update_url}myipv6=${_new_IPv6}" + if [[ $_serviceProvider == "dynv6" ]]; then + dyndns_update_url="${DYNV6_DYNDNS_UPDATE_URL}" + myip_str=ipv4 + myipv6_str=ipv6 fi - result=$(curl --silent --user $_username:$_password "${dyndns_update_url}" ) - case $result in + if [[ $_is_IPv4_enabled == true ]] && [[ $_is_IPv6_enabled == true ]]; then + dyndns_update_url="${dyndns_update_url}${myip_str}=${_new_IPv4}&${myipv6_str}=${_new_IPv6}" + fi + if [[ $_is_IPv4_enabled == true ]] && [[ $_is_IPv6_enabled == false ]]; then + dyndns_update_url="${dyndns_update_url}${myip_str}=${_new_IPv4}" + fi + if [[ $_is_IPv4_enabled == false ]] && [[ $_is_IPv6_enabled == true ]]; then + dyndns_update_url="${dyndns_update_url}${myipv6_str}=${_new_IPv6}" + fi + + ## request ## + if [[ $_serviceProvider == "dynv6" ]]; then + response=$(curl --silent "${dyndns_update_url}" ) + #echo $dyndns_update_url + fi + if [[ $_serviceProvider == "inwx" ]]; then + response=$(curl --silent --user "$_username":"$_password" "${dyndns_update_url}" ) + fi + + case $response in good ) echo "The DynDNS update has been executed." return @@ -220,6 +241,10 @@ function dynupdate() { echo "There is an internal error in the dyndns update system" return ;; + * ) + echo "$response" + return + ;; esac }