More debugs.

This commit is contained in:
Root User 2026-03-03 14:21:24 +01:00
parent 79c43434f4
commit deaece952a
Signed by: root
GPG key ID: 087F0A95E5766D72

View file

@ -674,6 +674,9 @@ in {
else
auth_header="Authorization: Bearer"
fi
# Output for debugging
${pkgs.util-linux}/bin.logger -s "DDNS Updater: Using auth_method ''${auth_method} with header ''${auth_header}"
###########################################
## Seek for the A record
@ -685,6 +688,10 @@ in {
-H "''$auth_header ''$auth_key" \
-H "Content-Type: application/json")
# Output for debugging
CURL_EXIT=$?
${pkgs.util-linux}/bin.logger -s "DDNS Updater: Cloudflare GET exit=$CURL_EXIT response=$record"
###########################################
## Check if the domain has an A record
###########################################
@ -692,6 +699,9 @@ in {
${pkgs.util-linux}/bin/logger -s "DDNS Updater: Record does not exist, perhaps create one first? (''${CURRENT_IP} for ''${record_name})"
exit 1
fi
# Output for debugging
${pkgs.util-linux}/bin.logger -s "DDNS Updater: Record found for ''${record_name}, checking IP..."
###########################################
## Get existing IP
@ -702,11 +712,17 @@ in {
${pkgs.util-linux}/bin/logger "DDNS Updater: IP ($CURRENT_IP) for ''${record_name} has not changed."
exit 0
fi
# Output for debugging
${pkgs.util-linux}/bin.logger -s "DDNS Updater: Current IP ($CURRENT_IP) is different from old IP ($old_ip) for ''${record_name}, updating record..."
###########################################
## Set the record identifier from result
###########################################
record_identifier=$(echo "$record" | sed -E 's/.*"id":"([A-Za-z0-9_]+)".*/\\1/')
# Output for debugging
${pkgs.util-linux}/bin.logger -s "DDNS Updater: Record identifier for ''${record_name} is ''${record_identifier}"
###########################################
## Change the IP@Cloudflare using the API