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

21 Commits

Author SHA1 Message Date
b083080c9d doc: 📝 document example of an docker-compose.yml file 2021-11-03 18:09:42 +01:00
48df7c7646 feat: add Dockerfile 2021-11-03 18:09:42 +01:00
b1f6c5a0fd doc: 📝 document loop mode and mention dig as requirement 2021-11-03 18:09:42 +01:00
17e23e7623 feat: add loop mode 2021-11-03 18:09:41 +01:00
bb1e0db9bf doc: 📝 update example of .env in README.md 2021-11-03 18:09:41 +01:00
29c2f62292 change: 🔃 rename environment variables 2021-11-03 18:09:41 +01:00
c85d5eaaee feat: add support for Duck DNS as DynDNS2 provider 2021-11-03 18:09:40 +01:00
3221f29d71 feat: add support for deSEC as DynDNS2 provider 2021-11-03 18:09:40 +01:00
706b6d84c1 feat: add completion
 add man page
2021-11-03 18:09:39 +01:00
6d9bf8a2ae feat: 🔃 replace getopt with argbash 2021-11-03 18:09:39 +01:00
6a14d00256 fix: 🐛 fix error handling 2021-11-03 18:09:39 +01:00
dff0c1c178 refactor: ♻️ main code 2021-11-03 18:09:38 +01:00
9bac611ddf feat: add interpretaton of status codes and act accordingly 2021-11-03 18:09:38 +01:00
1bb0f44d28 feat: make network interface configurable 2021-11-03 18:09:38 +01:00
730858344c fix: 🐛 fix sourcing of config file
♻️ do some shellcheck fixes
2021-11-03 18:09:02 +01:00
e3781a87bb feat: add DynDNS2 support for dynv6.com 2021-11-03 17:00:44 +01:00
fa5086f197 doc: 📝 CHANGELOG.md 2021-11-03 17:00:21 +01:00
3fa15b4d9d minor: 📝 .gitchangelog.rc 2021-11-03 16:59:05 +01:00
2c90e74bf5 doc: 📝 add example.env 2021-11-03 16:57:53 +01:00
cddcd9cfca add: 📝 README.md 2021-11-03 16:56:55 +01:00
616c1d47c1 add: dynb.sh 2021-11-03 16:56:39 +01:00
2 changed files with 5 additions and 34 deletions

View File

@@ -1,13 +1,6 @@
# Changelog # Changelog
## 0.1.1 (2021-04-23)
### Fix
* :bug: fix loop and error handling in case of connection issues. [Eduard Veit]
## 0.1.0 (2021-04-22) ## 0.1.0 (2021-04-22)
### New ### New

32
dynb.sh
View File

@@ -65,7 +65,7 @@ _response=
_statusHostname= _statusHostname=
_statusUsername= _statusUsername=
_statusPassword= _statusPassword=
_version=0.1.1 _version=0.1.0
_userAgent="DynB/$_version github.com/EV21/dynb" _userAgent="DynB/$_version github.com/EV21/dynb"
_configFile=$HOME/.local/share/dynb/.env _configFile=$HOME/.local/share/dynb/.env
_statusFile=/tmp/dynb.status _statusFile=/tmp/dynb.status
@@ -656,40 +656,18 @@ function checkStatus() {
function ipHasChanged() { function ipHasChanged() {
if [[ ${1} == 4 ]]; then if [[ ${1} == 4 ]]; then
remote_ip=$(getRemoteIP 4 $_ipv4_checker) remote_ip=$(getRemoteIP 4 $_ipv4_checker)
#TODO: this is doublicated code, refactor this some time
if [[ $? -gt 0 ]]; then
echoerr "IPCheck (getRemoteIP) request failed $remote_ip"
return 0
fi
if [[ $DYNB_UPDATE_METHOD == domrobot ]]; then if [[ $DYNB_UPDATE_METHOD == domrobot ]]; then
dns_ip=$(getDNSIP A) dns_ip=$(getDNSIP A)
else else
dig_response=$(dig @${_DNS_checkServer} in a +short "$DYNB_DYN_DOMAIN") dns_ip=$(dig @${_DNS_checkServer} in a +short "$DYNB_DYN_DOMAIN")
#TODO: this is doublicated code, refactor this some time
if [[ $dig_response == ";; connection timed out; no servers could be reached" ]]; then
echoerr "DNS request failed $dig_response"
return 0
fi
dns_ip=$dig_response
fi fi
fi fi
if [[ ${1} == 6 ]]; then if [[ ${1} == 6 ]]; then
remote_ip=$(getRemoteIP 6 $_ipv6_checker) remote_ip=$(getRemoteIP 6 $_ipv6_checker)
#TODO: this is doublicated code, refactor this some time
if [[ $? -gt 0 ]]; then
echoerr "IPCheck (getRemoteIP) request failed $remote_ip"
return 0
fi
if [[ $DYNB_UPDATE_METHOD == domrobot ]]; then if [[ $DYNB_UPDATE_METHOD == domrobot ]]; then
dns_ip=$(getDNSIP AAAA) dns_ip=$(getDNSIP AAAA)
else else
dig_response=$(dig @${_DNS_checkServer} in aaaa +short "$DYNB_DYN_DOMAIN") dns_ip=$(dig @${_DNS_checkServer} in aaaa +short "$DYNB_DYN_DOMAIN")
#TODO: this is doublicated code, refactor this some time
if [[ $dig_response == ";; connection timed out; no servers could be reached" ]]; then
echoerr "DNS request failed $dig_response"
return 0
fi
dns_ip=$dig_response
fi fi
fi fi
@@ -869,7 +847,7 @@ function doUpdates() {
debugMessage "Skip DynDNS2 update, checkStatus fetched previous error." debugMessage "Skip DynDNS2 update, checkStatus fetched previous error."
fi fi
else else
debugMessage "Skip DynDNS2 update, IPs are up to date or there is a connection problem" debugMessage "Skip DynDNS2 update, IPs are up to date"
fi fi
fi fi
} }
@@ -904,7 +882,7 @@ function dynb() {
if loopMode; then if loopMode; then
while : while checkStatus
do do
doUpdates doUpdates
sleep $DYNB_INTERVAL sleep $DYNB_INTERVAL