fix(ingress.tjo.cloud/dyndns): issues
Some checks failed
/ lint (push) Failing after 37s

This commit is contained in:
Tine 2025-01-06 19:38:27 +01:00
parent 8cd317fe6f
commit deca3a9d55
Signed by: mentos1386
SSH key fingerprint: SHA256:MNtTsLbihYaWF8j1fkOHfkKNlnN1JQfxEU/rBU8nCGw
2 changed files with 2 additions and 9 deletions

View file

@ -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 \

View file

@ -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..."