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"