From afe8d51b75be897c002dbe2cec0a0d9019b70a94 Mon Sep 17 00:00:00 2001 From: Christine Elisabeth Koppel Date: Tue, 3 Mar 2026 13:16:32 +0100 Subject: [PATCH] Update DDNS Updater to use record name from argument. --- nix-system-configs/modules/system/traefik.nix | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/nix-system-configs/modules/system/traefik.nix b/nix-system-configs/modules/system/traefik.nix index 0d19bc9..1ce1d16 100644 --- a/nix-system-configs/modules/system/traefik.nix +++ b/nix-system-configs/modules/system/traefik.nix @@ -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 '';