mirror of
https://github.com/EV21/dynb.git
synced 2025-12-26 16:39:32 +01:00
Compare commits
1 Commits
4d28f55ce9
...
642e53aadf
| Author | SHA1 | Date | |
|---|---|---|---|
|
642e53aadf
|
@@ -5,6 +5,8 @@
|
|||||||
|
|
||||||
### New
|
### New
|
||||||
|
|
||||||
|
* :sparkles: add support for Duck DNS as DynDNS2 provider. [Eduard Veit]
|
||||||
|
|
||||||
* :sparkles: add support for deSEC as DynDNS2 provider. [Eduard Veit]
|
* :sparkles: add support for deSEC as DynDNS2 provider. [Eduard Veit]
|
||||||
|
|
||||||
* :sparkles: add completion. [Eduard Veit]
|
* :sparkles: add completion. [Eduard Veit]
|
||||||
|
|||||||
@@ -25,8 +25,9 @@ The following update methods are currently implemented:
|
|||||||
### DynDNS2
|
### DynDNS2
|
||||||
|
|
||||||
* INWX.com
|
* INWX.com
|
||||||
* dynv6.com
|
|
||||||
* deSEC.io (dedyn.io)
|
* deSEC.io (dedyn.io)
|
||||||
|
* DuckDNS.org
|
||||||
|
* dynv6.com
|
||||||
|
|
||||||
## 📦 Requirements
|
## 📦 Requirements
|
||||||
|
|
||||||
|
|||||||
27
dynb.sh
27
dynb.sh
@@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
_dyn_domain=
|
_dyn_domain=
|
||||||
|
|
||||||
## service provider could be inwx
|
## service provider could be deSEC, duckdns, dynv6, inwx
|
||||||
_serviceProvider=
|
_serviceProvider=
|
||||||
|
|
||||||
## update method options: domrobot, dyndns
|
## update method options: domrobot, dyndns
|
||||||
@@ -287,6 +287,7 @@ parse_commandline "$@"
|
|||||||
### END OF CODE GENERATED BY Argbash (sortof) ### ])
|
### END OF CODE GENERATED BY Argbash (sortof) ### ])
|
||||||
# [ <-- needed because of Argbash
|
# [ <-- needed because of Argbash
|
||||||
|
|
||||||
|
# The generated argbash help message does not look as nice as this:
|
||||||
_help_message="$(cat << 'EOF'
|
_help_message="$(cat << 'EOF'
|
||||||
dynb - dynamic DNS update script for bash
|
dynb - dynamic DNS update script for bash
|
||||||
|
|
||||||
@@ -430,20 +431,26 @@ function dynupdate() {
|
|||||||
|
|
||||||
INWX_DYNDNS_UPDATE_URL="https://dyndns.inwx.com/nic/update?"
|
INWX_DYNDNS_UPDATE_URL="https://dyndns.inwx.com/nic/update?"
|
||||||
DESEC_DYNDNS_UPDATE_URL="https://update.dedyn.io/?"
|
DESEC_DYNDNS_UPDATE_URL="https://update.dedyn.io/?"
|
||||||
|
DUCKDNS_DYNDNS_UPDATE_URL="https://www.duckdns.org/update?domains=$_dyn_domain&token=$_token&"
|
||||||
DYNV6_DYNDNS_UPDATE_URL="https://dynv6.com/api/update?zone=$_dyn_domain&token=$_token&"
|
DYNV6_DYNDNS_UPDATE_URL="https://dynv6.com/api/update?zone=$_dyn_domain&token=$_token&"
|
||||||
|
|
||||||
case $_serviceProvider in
|
case $_serviceProvider in
|
||||||
inwx | INWX )
|
inwx* | INWX* )
|
||||||
dyndns_update_url=$INWX_DYNDNS_UPDATE_URL
|
dyndns_update_url=$INWX_DYNDNS_UPDATE_URL
|
||||||
;;
|
;;
|
||||||
deSEC | desec* | dedyn* )
|
deSEC* | desec* | dedyn* )
|
||||||
dyndns_update_url="${DESEC_DYNDNS_UPDATE_URL}"
|
dyndns_update_url="${DESEC_DYNDNS_UPDATE_URL}"
|
||||||
;;
|
;;
|
||||||
dynv6 )
|
dynv6* )
|
||||||
dyndns_update_url="${DYNV6_DYNDNS_UPDATE_URL}"
|
dyndns_update_url="${DYNV6_DYNDNS_UPDATE_URL}"
|
||||||
myip_str=ipv4
|
myip_str=ipv4
|
||||||
myipv6_str=ipv6
|
myipv6_str=ipv6
|
||||||
;;
|
;;
|
||||||
|
DuckDNS* | duckdns* )
|
||||||
|
dyndns_update_url="${DUCKDNS_DYNDNS_UPDATE_URL}"
|
||||||
|
myip_str=ipv4
|
||||||
|
myipv6_str=ipv6
|
||||||
|
;;
|
||||||
* )
|
* )
|
||||||
echoerr "$_serviceProvider is not supported"
|
echoerr "$_serviceProvider is not supported"
|
||||||
exit 1
|
exit 1
|
||||||
@@ -464,20 +471,20 @@ function dynupdate() {
|
|||||||
|
|
||||||
## request ##
|
## request ##
|
||||||
case $_serviceProvider in
|
case $_serviceProvider in
|
||||||
inwx | INWX )
|
inwx* | INWX* )
|
||||||
_response=$(curl --silent "$_interface_str" \
|
_response=$(curl --silent "$_interface_str" \
|
||||||
--user-agent "$_userAgent" \
|
--user-agent "$_userAgent" \
|
||||||
--user "$_username":"$_password" \
|
--user "$_username":"$_password" \
|
||||||
"${dyndns_update_url}" )
|
"${dyndns_update_url}" )
|
||||||
;;
|
;;
|
||||||
deSEC | desec* | dedyn* )
|
deSEC* | desec* | dedyn* )
|
||||||
_response=$(curl --silent "$_interface_str" \
|
_response=$(curl --silent "$_interface_str" \
|
||||||
--user-agent "$_userAgent" \
|
--user-agent "$_userAgent" \
|
||||||
--header "Authorization: Token $_token" \
|
--header "Authorization: Token $_token" \
|
||||||
--get --data-urlencode "hostname=$_dyn_domain" \
|
--get --data-urlencode "hostname=$_dyn_domain" \
|
||||||
"${dyndns_update_url}" )
|
"${dyndns_update_url}" )
|
||||||
;;
|
;;
|
||||||
dynv6 )
|
dynv6* | duckDNS* | duckdns* )
|
||||||
_response=$(curl --silent "$_interface_str" \
|
_response=$(curl --silent "$_interface_str" \
|
||||||
--user-agent "$_userAgent" \
|
--user-agent "$_userAgent" \
|
||||||
"${dyndns_update_url}"
|
"${dyndns_update_url}"
|
||||||
@@ -486,7 +493,7 @@ function dynupdate() {
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
case $_response in
|
case $_response in
|
||||||
good* )
|
good* | OK* )
|
||||||
if [[ $_response == "good 127.0.0.1" ]]; then
|
if [[ $_response == "good 127.0.0.1" ]]; then
|
||||||
echoerr "Error: $_response: Request ignored."
|
echoerr "Error: $_response: Request ignored."
|
||||||
return 1
|
return 1
|
||||||
@@ -645,10 +652,10 @@ function ipHasChanged() {
|
|||||||
|
|
||||||
if [[ ${1} == 4 ]]; then
|
if [[ ${1} == 4 ]]; then
|
||||||
_new_IPv4=$remote_ip
|
_new_IPv4=$remote_ip
|
||||||
#echo "New IPv4: $_new_IPv4 old was: $dns_ip"
|
debugMessage "New IPv4: $_new_IPv4 old was: $dns_ip"
|
||||||
else
|
else
|
||||||
_new_IPv6=$remote_ip
|
_new_IPv6=$remote_ip
|
||||||
#echo "New IPv6: $_new_IPv6 old was: $dns_ip"
|
debugMessage "New IPv6: $_new_IPv6 old was: $dns_ip"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$remote_ip" == "$dns_ip" ]]; then
|
if [[ "$remote_ip" == "$dns_ip" ]]; then
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ dyndns.example.com
|
|||||||
.BI \-s \ SERVICE\-PROVIDER\fR,\fB \ \-\-service\-provider \ SERVICE\-PROVIDER
|
.BI \-s \ SERVICE\-PROVIDER\fR,\fB \ \-\-service\-provider \ SERVICE\-PROVIDER
|
||||||
set your provider in case you are using DynDNS2.
|
set your provider in case you are using DynDNS2.
|
||||||
.sp
|
.sp
|
||||||
inwx | dynv6 | deSEC
|
deSEC | duckdns | dynv6 | inwx
|
||||||
.TP
|
.TP
|
||||||
.BI \-u \ USERNAME\fR,\fB \ \-\-username \ USERNAME
|
.BI \-u \ USERNAME\fR,\fB \ \-\-username \ USERNAME
|
||||||
depends on your selected update method and your provider.
|
depends on your selected update method and your provider.
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
.. |OPTION_DOMAIN| replace:: dyndns.example.com
|
.. |OPTION_DOMAIN| replace:: dyndns.example.com
|
||||||
|
|
||||||
.. |OPTION_SERVICE_PROVIDER| replace:: inwx | dynv6 | deSEC
|
.. |OPTION_SERVICE_PROVIDER| replace:: deSEC | duckdns | dynv6 | inwx
|
||||||
|
|
||||||
.. |OPTION_USERNAME| replace:: e.g. user42
|
.. |OPTION_USERNAME| replace:: e.g. user42
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user