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 else
auth_header="Authorization: Bearer" auth_header="Authorization: Bearer"
fi 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 ## Seek for the A record
@ -685,6 +688,10 @@ in {
-H "''$auth_header ''$auth_key" \ -H "''$auth_header ''$auth_key" \
-H "Content-Type: application/json") -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 ## 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})" ${pkgs.util-linux}/bin/logger -s "DDNS Updater: Record does not exist, perhaps create one first? (''${CURRENT_IP} for ''${record_name})"
exit 1 exit 1
fi fi
# Output for debugging
${pkgs.util-linux}/bin.logger -s "DDNS Updater: Record found for ''${record_name}, checking IP..."
########################################### ###########################################
## Get existing 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." ${pkgs.util-linux}/bin/logger "DDNS Updater: IP ($CURRENT_IP) for ''${record_name} has not changed."
exit 0 exit 0
fi 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 ## Set the record identifier from result
########################################### ###########################################
record_identifier=$(echo "$record" | sed -E 's/.*"id":"([A-Za-z0-9_]+)".*/\\1/') 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 ## Change the IP@Cloudflare using the API