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 fi
done done
# Exit if IP fetching failed # If a record name was passed as first argument, use it (wrapper now passes it)
if [[ -z "''${CURRENT_IP}" ]]; then if [ -n "$1" ]; then
${pkgs.util-linux}/bin/logger -s "DDNS Updater: Failed to find a valid IP." record_name="$1"
exit 2 ${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 fi
########################################### ###########################################
@ -749,7 +751,7 @@ in {
export record_name="$r.${domain}" export record_name="$r.${domain}"
fi fi
# Invoke the single-run script explicitly with the system's bash via env to avoid /bin/bash shebang issues # 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 done
''; '';