From deca3a9d556aee2aab335780b1c33dc9a1dd2520 Mon Sep 17 00:00:00 2001 From: Tine Date: Mon, 6 Jan 2025 19:38:27 +0100 Subject: [PATCH] fix(ingress.tjo.cloud/dyndns): issues --- ingress.tjo.cloud/install.sh | 1 - ingress.tjo.cloud/root/usr/local/bin/dyndns | 10 ++-------- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/ingress.tjo.cloud/install.sh b/ingress.tjo.cloud/install.sh index 6eef523..ab2decd 100755 --- a/ingress.tjo.cloud/install.sh +++ b/ingress.tjo.cloud/install.sh @@ -36,7 +36,6 @@ DNSIMPLE_TOKEN=$(jq -r ".dnsimple.token" /etc/tjo.cloud/meta.json) ## echo "== Install Dependencies" apt update -y - apt install -y \ gpg \ git \ diff --git a/ingress.tjo.cloud/root/usr/local/bin/dyndns b/ingress.tjo.cloud/root/usr/local/bin/dyndns index 0ec2a5d..56680ae 100755 --- a/ingress.tjo.cloud/root/usr/local/bin/dyndns +++ b/ingress.tjo.cloud/root/usr/local/bin/dyndns @@ -122,9 +122,6 @@ configure::single() { } configure::many() { - # disable glob expansion - set -f - domain_records=$1 domain=$2 ip=$3 @@ -133,9 +130,6 @@ configure::many() { record_id=$(echo "$domain_records" | jq ".data[] | select(.type == \"$type\" and .name == \"$domain\" and .content == \"$ip\") | .id") record_data=$(echo "$domain_records" | jq ".data[] | select(.type == \"$type\" and .name == \"$domain\" and .content == \"$ip\") | .content") - # re-enable glob expansion - set +f - data="{\"type\": \"$type\", \"name\": \"$domain\", \"content\": \"$ip\", \"ttl\": $record_ttl}" if [[ -z $record_id ]]; then @@ -200,7 +194,7 @@ while (true); do log::info "type=A Checking for stale records..." echo "$domain_records" | jq -r ".data[] | select(.type == \"A\" and .name != \"$CLOUD_REGION\") | .id" | while read -r record_id; do record_name=$(echo "$domain_records" | jq -r ".data[] | select(.id == \"$record_id\") | .name") - record_ip=$(echo "$domain_records" | jq -r ".data[] | select(.id == \"$domain\") | .content") + record_ip=$(echo "$domain_records" | jq -r ".data[] | select(.id == \"$record_id\") | .content") log::info "type=A domain=$record_name ip=$record_ip Checking..." if ! healthcheck "$record_ip"; then log::warn "type=A domain=$record_name ip=$record_ip Unhealthy..." @@ -213,7 +207,7 @@ while (true); do log::info "type=AAAA Checking for stale records..." echo "$domain_records" | jq -r ".data[] | select(.type == \"AAAA\" and .name != \"$CLOUD_REGION\") | .id" | while read -r record_id; do record_name=$(echo "$domain_records" | jq -r ".data[] | select(.id == \"$record_id\") | .name") - record_ip=$(echo "$domain_records" | jq -r ".data[] | select(.id == \"$domain\") | .content") + record_ip=$(echo "$domain_records" | jq -r ".data[] | select(.id == \"$record_id\") | .content") log::info "type=AAAA domain=$record_name ip=$record_ip Checking..." if ! healthcheck "[$record_ip]"; then log::warn "type=AAAA domain=$record_name ip=$record_ip Unhealthy..."