From 44a32b9c9f0af34ecd08b0adfe1cf24b2c9f6844 Mon Sep 17 00:00:00 2001 From: Christine Elisabeth Koppel Date: Tue, 3 Mar 2026 12:50:41 +0100 Subject: [PATCH] Fix broken bash script value edge-case --- nix-system-configs/modules/system/traefik.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/nix-system-configs/modules/system/traefik.nix b/nix-system-configs/modules/system/traefik.nix index cc41803..f7e763b 100644 --- a/nix-system-configs/modules/system/traefik.nix +++ b/nix-system-configs/modules/system/traefik.nix @@ -614,8 +614,11 @@ in { ) # Try all the ip services for a valid IPv4 address - for service in $${IP_SERVICES[@]}; do - RAW_IP=$(${pkgs.curl}/bin/curl -s $service) + for service in "$${IP_SERVICES[@]}"; do + echo "Testing service: $service" + RAW_IP=$(curl -s "$service") + RAW_IP=$(echo "$RAW_IP" | tr -d '\n' | tr -d '\r' | xargs) + echo "RAW_IP: '$RAW_IP'" if [[ $RAW_IP =~ $REGEX_IPV4 ]]; then CURRENT_IP=$BASH_REMATCH ${pkgs.util-linux}/bin/logger -s "DDNS Updater: Fetched IP $CURRENT_IP"