Skip to content

Commit

Permalink
🚑 Ensure TLS port has a valid value
Browse files Browse the repository at this point in the history
  • Loading branch information
frenck committed May 31, 2020
1 parent edd538a commit 795c827
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions adguard/rootfs/etc/cont-init.d/nginx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,15 @@ declare dns_host
declare ingress_interface
declare ingress_port
declare keyfile

if bashio::var.true "$(yq read /data/adguard/AdGuardHome.yaml tls.enabled)"; then
adguard_port=$(yq read /data/adguard/AdGuardHome.yaml tls.port_https)
adguard_protocol=https
declare tls_port

if bashio::var.true "$(yq read /data/adguard/AdGuardHome.yaml tls.enabled)";
then
tls_port=$(yq read /data/adguard/AdGuardHome.yaml tls.port_https)
if bashio::var.has_value "${tls_port}" && [[ "${tls_port}" -ne 0 ]]; then
adguard_port="${tls_port}"
adguard_protocol=https
fi
fi

sed -i "s#%%port%%#${adguard_port}#g" /etc/nginx/includes/upstream.conf
Expand Down

0 comments on commit 795c827

Please sign in to comment.