1
0
mirror of https://github.com/EV21/dynb.git synced 2025-12-26 16:39:32 +01:00

7 Commits
0.5.1 ... main

4 changed files with 35 additions and 21 deletions

View File

@@ -1,6 +1,20 @@
# Changelog
## 0.5.3 (2023-02-26)
### Fix
* Set constant alpine version as latest couses issues. [Eduard Veit]
## 0.5.2 (2023-02-26)
### Fix
* Incorrect dns ip handling via domrobot. [Eduard Veit]
## 0.5.1 (2022-11-21)
### Features

View File

@@ -1,4 +1,4 @@
FROM alpine:latest
FROM alpine:3.16.4
RUN \
apk update \

View File

@@ -24,15 +24,15 @@ IPv4 (A) and IPv6 (AAAA) record updates are supported.
The following update methods are currently implemented:
| Provider | API | TTL in seconds | Credentials | own domain via NS record | free (sub-) domain |
|---------------------|-----------------------|----------------|----------------------------------------------------------------------------------------------|--------------------------|------------------------------------------------|
| INWX.com | Domrobot JSON-RPC-API | 300 | customer login `username` & `password`. Mobile TAN (OTP) is currently not supported by DynB. | ✔️ | ⛔ choose one of your owned domains |
| INWX.com | DynDNS2 | 60 | specific dyndns `username` & `password` | ✔️ | ⛔ choose one of your owned domains per account |
| deSEC.io (dedyn.io) | DynDNS2 | 60 | `token` | ✔️ | ✔️ |
|---------------------|-----------------------|----------------|----------------------------------------------------------------------------------------------|------------------------------------------|--------------------------------------|
| INWX.com | Domrobot JSON-RPC-API | 300 | customer login `username` & `password`. Mobile TAN (OTP) is currently not supported by DynB. | ✔️ 🆓 for your registered domains @ inwx | ⛔ for your registered domains @ inwx |
| INWX.com | DynDNS2 | 60 | specific dyndns `username` & `password` | ✔️ 🆓 for your registered domains @ inwx | ⛔ for your registered domains @ inwx |
| deSEC.io (dedyn.io) | DynDNS2 | 60 | `token` | ✔️ 🆓 | ✔️ |
| DuckDNS.org | DynDNS2 | 60 | `token` | ⛔ | ✔️ |
| dynv6.com | DynDNS2 | 60 | `token` | ✔️ | ✔️ |
| dynv6.com | DynDNS2 | 60 | `token` | ✔️ 🆓 | ✔️ |
| ddnss.de | DynDNS2 | 10 | `update key` as `token` | ⛔ | ✔️ |
| IPv64.net | DynDNS2 | 60 | `DynDNS Updatehash` as `token` | | ✔️ |
| dynu.com | DynDNS2 | 30 | `username` & `password` | ✔️ | ✔️ |
| IPv64.net | DynDNS2 | 60 | `DynDNS Updatehash` as `token` | ✔️ 💲 | ✔️ |
| dynu.com | DynDNS2 | 30 | `username` & `password` | ✔️ 🆓 | ✔️ |
## 📦 Requirements

20
dynb.sh
View File

@@ -70,7 +70,7 @@ _response=
_statusHostname=
_statusUsername=
_statusPassword=
_version=0.5.1
_version=0.5.3
_userAgent="DynB/$_version github.com/EV21/dynb"
_configFile=$HOME/.local/share/dynb/.env
_statusFile=/tmp/dynb.status
@@ -130,7 +130,7 @@ function is_ip_address
result=$?
;;
esac
return $result
return "$result"
}
function loopMode
@@ -222,7 +222,7 @@ function fetchDNSRecords
function getRecordID
{
echo "$_dns_records" |
jq "select(.type == \"${1}\") | .id"
jq --raw-output "select(.type == \"${1}\") | .id"
}
## do_dig_request A B
@@ -235,11 +235,11 @@ function do_dig_request
{
local dns_server=$1
local record_type=$2
dig_response=$(dig @"$dns_server" in "$record_type" +short "$DYNB_DYN_DOMAIN")
dig_response=$(dig @"$dns_server" in "$record_type" +short "$DYNB_DYN_DOMAIN" 2>&1)
dig_exitcode=$?
if [[ $dig_exitcode -gt 0 ]]
then
errorMessage "DNS request failed with exit code: $dig_exitcode $dig_response"
errorMessage "DNS request for $record_type @ $dns_server failed with exit code: $dig_exitcode $dig_response"
unset _dns_ip
return 1
else
@@ -271,8 +271,8 @@ function getDNSIP() {
local record_type=$1
if [[ $DYNB_UPDATE_METHOD == domrobot ]]
then
echo "$_dns_records" |
jq --raw-output "select(.type == \"${record_type}\") | .content"
_dns_ip=$(echo "$_dns_records" |
jq --raw-output "select(.type == \"${record_type}\") | .content")
else
for current_dns_server in "${provider_dns_servers[@]}"
do
@@ -322,7 +322,7 @@ function getRemoteIP
# shellcheck disable=2181
if [[ $curls_status_code -gt 0 ]]
then
errorMessage "Remote IPv$ip_version request failed with ${current_check_server} curl status code: $curls_status_code"
errorMessage "Remote IPv$ip_version request @ ${current_check_server} failed with curl status code: $curls_status_code"
_has_remote_ip_error=true
return_value=1
else
@@ -354,7 +354,7 @@ function getRemoteIP
fi
;;
esac
return $return_value
return "$return_value"
}
# requires parameter
@@ -1072,7 +1072,7 @@ function main
do
doUpdates
debugMessage "wait $DYNB_INTERVAL seconds until next check"
sleep $DYNB_INTERVAL
sleep "$DYNB_INTERVAL"
done
else doUpdates
fi