mirror of
https://github.com/aljazceru/addons.git
synced 2025-12-17 13:14: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",
|
"name": "Duck DNS",
|
||||||
"version": "1.6",
|
"version": "1.7",
|
||||||
"slug": "duckdns",
|
"slug": "duckdns",
|
||||||
"description": "Free Dynamic DNS (DynDNS or DDNS) service with Let's Encrypt support",
|
"description": "Free Dynamic DNS (DynDNS or DDNS) service with Let's Encrypt support",
|
||||||
"url": "https://www.home-assistant.io/addons/duckdns/",
|
"url": "https://www.home-assistant.io/addons/duckdns/",
|
||||||
@@ -24,6 +24,8 @@
|
|||||||
"certfile": "str",
|
"certfile": "str",
|
||||||
"keyfile": "str"
|
"keyfile": "str"
|
||||||
},
|
},
|
||||||
|
"ipv4": "str?",
|
||||||
|
"ipv6": "str?",
|
||||||
"token": "str",
|
"token": "str",
|
||||||
"domains": ["str"],
|
"domains": ["str"],
|
||||||
"seconds": "int"
|
"seconds": "int"
|
||||||
|
|||||||
@@ -11,6 +11,8 @@ LE_DOMAINS=$(jq --raw-output '.domains[]' $CONFIG_PATH)
|
|||||||
LE_UPDATE="0"
|
LE_UPDATE="0"
|
||||||
|
|
||||||
# DuckDNS
|
# DuckDNS
|
||||||
|
IPV4=$(jq --raw-output '.ipv4 // empty' $CONFIG_PATH)
|
||||||
|
IPV6=$(jq --raw-output '.ipv6 // empty' $CONFIG_PATH)
|
||||||
TOKEN=$(jq --raw-output '.token' $CONFIG_PATH)
|
TOKEN=$(jq --raw-output '.token' $CONFIG_PATH)
|
||||||
DOMAINS=$(jq --raw-output '.domains | join(",")' $CONFIG_PATH)
|
DOMAINS=$(jq --raw-output '.domains | join(",")' $CONFIG_PATH)
|
||||||
WAIT_TIME=$(jq --raw-output '.seconds' $CONFIG_PATH)
|
WAIT_TIME=$(jq --raw-output '.seconds' $CONFIG_PATH)
|
||||||
@@ -45,7 +47,7 @@ fi
|
|||||||
|
|
||||||
# Run duckdns
|
# Run duckdns
|
||||||
while true; do
|
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"
|
echo "$(date): $answer"
|
||||||
|
|
||||||
now="$(date +%s)"
|
now="$(date +%s)"
|
||||||
|
|||||||
Reference in New Issue
Block a user