Skip to content

Commit

Permalink
merge variables
Browse files Browse the repository at this point in the history
  • Loading branch information
p0lycarpio committed Jul 17, 2023
1 parent 4cacec7 commit 9d3e78e
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ ARG DUCKDNS_VERSION
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
LABEL maintainer="aptalca"

ENV UPDATE_IP=ipv4

RUN \
echo "**** install packages ****" && \
apk add --no-cache \
Expand Down
2 changes: 2 additions & 0 deletions Dockerfile.aarch64
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ ARG DUCKDNS_VERSION
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
LABEL maintainer="aptalca"

ENV UPDATE_IP=ipv4

RUN \
echo "**** install packages ****" && \
apk add --no-cache \
Expand Down
2 changes: 1 addition & 1 deletion readme-vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ cap_add_param_vars: ""
# optional container parameters
opt_param_usage_include_env: true
opt_param_env_vars:
- { env_var: "FORCE_IPV6", env_value: "false", desc: "Set to `true` to update IP **only** with your public IPv6 address. NB: use only if you have a public IPv6 address."}
- { env_var: "UPDATE_IP", env_value: "ipv4", desc: "Set to `ipv6` to update **only** with your public IPv6 address. Set to `both` to update IPv6 and IPv4 address. Default to `ipv4`"}
- { env_var: "LOG_FILE", env_value: "false", desc: "Set to `true` to log to file (also need to map /config)."}
opt_param_usage_include_vols: true
opt_param_volumes:
Expand Down
8 changes: 6 additions & 2 deletions root/app/duck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,14 @@ else
fi

{
if [ "${FORCE_IPV6}" = "true" ]; then
if [ "${UPDATE_IP}" = "both" ]; then
IPV4=$(curl -sS4 "https://ipconfig.io")
IPV6=$(curl -sS6 "https://ipconfig.io")
RESPONSE=$(curl -sS --max-time 60 "https://www.duckdns.org/update?domains=${SUBDOMAINS}&token=${TOKEN}&ip=${IPV4}&ipv6=${IPV6}")
elif [ "${UPDATE_IP}" = "ipv6" ]; then
IPV6=$(curl -sS6 "https://ipconfig.io")
RESPONSE=$(curl -sS --max-time 60 "https://www.duckdns.org/update?domains=${SUBDOMAINS}&token=${TOKEN}&ip=${IPV6}")
else
elif [ "${UPDATE_IP}" = "ipv4" ]; then
RESPONSE=$(curl -sS --max-time 60 "https://www.duckdns.org/update?domains=${SUBDOMAINS}&token=${TOKEN}&ip=")
fi

Expand Down

0 comments on commit 9d3e78e

Please sign in to comment.