mirror of
https://codeberg.org/polyteknisk-radiogruppe/the_prg_server_configuration.git
synced 2026-06-13 18:28:55 +02:00
More debugs.
This commit is contained in:
parent
79c43434f4
commit
deaece952a
1 changed files with 16 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue