mirror of
https://github.com/EV21/dynb.git
synced 2025-12-26 16:39:32 +01:00
Compare commits
21 Commits
93c1ed18d0
...
0.1.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
b083080c9d
|
|||
|
48df7c7646
|
|||
|
b1f6c5a0fd
|
|||
|
17e23e7623
|
|||
|
bb1e0db9bf
|
|||
|
29c2f62292
|
|||
|
c85d5eaaee
|
|||
|
3221f29d71
|
|||
|
706b6d84c1
|
|||
|
6d9bf8a2ae
|
|||
|
6a14d00256
|
|||
|
dff0c1c178
|
|||
|
9bac611ddf
|
|||
|
1bb0f44d28
|
|||
|
730858344c
|
|||
|
e3781a87bb
|
|||
|
fa5086f197
|
|||
|
3fa15b4d9d
|
|||
|
2c90e74bf5
|
|||
|
cddcd9cfca
|
|||
|
616c1d47c1
|
@@ -1,13 +1,6 @@
|
||||
# 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)
|
||||
|
||||
### New
|
||||
|
||||
32
dynb.sh
32
dynb.sh
@@ -65,7 +65,7 @@ _response=
|
||||
_statusHostname=
|
||||
_statusUsername=
|
||||
_statusPassword=
|
||||
_version=0.1.1
|
||||
_version=0.1.0
|
||||
_userAgent="DynB/$_version github.com/EV21/dynb"
|
||||
_configFile=$HOME/.local/share/dynb/.env
|
||||
_statusFile=/tmp/dynb.status
|
||||
@@ -656,40 +656,18 @@ function checkStatus() {
|
||||
function ipHasChanged() {
|
||||
if [[ ${1} == 4 ]]; then
|
||||
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
|
||||
dns_ip=$(getDNSIP A)
|
||||
else
|
||||
dig_response=$(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
|
||||
dns_ip=$(dig @${_DNS_checkServer} in a +short "$DYNB_DYN_DOMAIN")
|
||||
fi
|
||||
fi
|
||||
if [[ ${1} == 6 ]]; then
|
||||
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
|
||||
dns_ip=$(getDNSIP AAAA)
|
||||
else
|
||||
dig_response=$(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
|
||||
dns_ip=$(dig @${_DNS_checkServer} in aaaa +short "$DYNB_DYN_DOMAIN")
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -869,7 +847,7 @@ function doUpdates() {
|
||||
debugMessage "Skip DynDNS2 update, checkStatus fetched previous error."
|
||||
fi
|
||||
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
|
||||
}
|
||||
@@ -904,7 +882,7 @@ function dynb() {
|
||||
|
||||
|
||||
if loopMode; then
|
||||
while :
|
||||
while checkStatus
|
||||
do
|
||||
doUpdates
|
||||
sleep $DYNB_INTERVAL
|
||||
|
||||
Reference in New Issue
Block a user