Update DDNS Updater to use record name from argument.

This commit is contained in:
Root User 2026-03-03 13:16:32 +01:00
parent 70c82683f6
commit afe8d51b75
Signed by: root
GPG key ID: 087F0A95E5766D72

View file

@ -628,10 +628,12 @@ in {
fi
done
# Exit if IP fetching failed
if [[ -z "''${CURRENT_IP}" ]]; then
${pkgs.util-linux}/bin/logger -s "DDNS Updater: Failed to find a valid IP."
exit 2
# If a record name was passed as first argument, use it (wrapper now passes it)
if [ -n "$1" ]; then
record_name="$1"
${pkgs.util-linux}/bin/logger -s "DDNS Updater: Using record_name from arg: '$record_name'"
else
${pkgs.util-linux}/bin/logger -s "DDNS Updater: No record_name arg provided; using record_name env: '$record_name'"
fi
###########################################
@ -749,7 +751,7 @@ in {
export record_name="$r.${domain}"
fi
# Invoke the single-run script explicitly with the system's bash via env to avoid /bin/bash shebang issues
${pkgs.bash}/bin/bash /etc/cloudflare-ddns/update-single.sh || true
${pkgs.bash}/bin/bash /etc/cloudflare-ddns/update-single.sh "$record_name" || true
done
'';