mirror of
https://github.com/aljazceru/addons.git
synced 2025-12-17 05:04:21 +01:00
Added config option to set ip for ipv4 and ipv6 (#627)
* Added config option to set ip for ipv4 and ipv6 * Made IPv4 and IPv6 optional * Added // empty
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "Duck DNS",
|
||||
"version": "1.6",
|
||||
"version": "1.7",
|
||||
"slug": "duckdns",
|
||||
"description": "Free Dynamic DNS (DynDNS or DDNS) service with Let's Encrypt support",
|
||||
"url": "https://www.home-assistant.io/addons/duckdns/",
|
||||
@@ -24,6 +24,8 @@
|
||||
"certfile": "str",
|
||||
"keyfile": "str"
|
||||
},
|
||||
"ipv4": "str?",
|
||||
"ipv6": "str?",
|
||||
"token": "str",
|
||||
"domains": ["str"],
|
||||
"seconds": "int"
|
||||
|
||||
@@ -11,6 +11,8 @@ LE_DOMAINS=$(jq --raw-output '.domains[]' $CONFIG_PATH)
|
||||
LE_UPDATE="0"
|
||||
|
||||
# DuckDNS
|
||||
IPV4=$(jq --raw-output '.ipv4 // empty' $CONFIG_PATH)
|
||||
IPV6=$(jq --raw-output '.ipv6 // empty' $CONFIG_PATH)
|
||||
TOKEN=$(jq --raw-output '.token' $CONFIG_PATH)
|
||||
DOMAINS=$(jq --raw-output '.domains | join(",")' $CONFIG_PATH)
|
||||
WAIT_TIME=$(jq --raw-output '.seconds' $CONFIG_PATH)
|
||||
@@ -45,7 +47,7 @@ fi
|
||||
|
||||
# Run duckdns
|
||||
while true; do
|
||||
answer="$(curl -sk "https://www.duckdns.org/update?domains=$DOMAINS&token=$TOKEN&ip=&verbose=true")" || true
|
||||
answer="$(curl -sk "https://www.duckdns.org/update?domains=$DOMAINS&token=$TOKEN&ip=$IPV4&ipv6=$IPV6&verbose=true")" || true
|
||||
echo "$(date): $answer"
|
||||
|
||||
now="$(date +%s)"
|
||||
|
||||
Reference in New Issue
Block a user