From d8d7e721a146ecce8944ec72a68505ba18a1d63e Mon Sep 17 00:00:00 2001 From: Christine Elisabeth Koppel Date: Tue, 3 Mar 2026 12:35:00 +0100 Subject: [PATCH] Fix broken bash URI edge-case --- nix-system-configs/modules/system/traefik.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nix-system-configs/modules/system/traefik.nix b/nix-system-configs/modules/system/traefik.nix index 49f5cbf..cc41803 100644 --- a/nix-system-configs/modules/system/traefik.nix +++ b/nix-system-configs/modules/system/traefik.nix @@ -688,11 +688,11 @@ in { case "$update" in *"\\\"success\\\":false"*) echo -e "DDNS Updater: $${CURRENT_IP} $${record_name} DDNS failed for $${record_identifier} ($${CURRENT_IP}). DUMPING RESULTS:\n$update" | ${pkgs.util-linux}/bin/logger -s - if [[ -n "$${slackuri}" ]]; then + if [[ $slackuri != "" ]]; then msg="$${sitename} DDNS Update Failed: $${record_name}: $${record_identifier} ($${CURRENT_IP})." ${pkgs.curl}/bin/curl -L -X POST "$${slackuri}" --data-raw "{\"channel\":\"$${slackchannel}\",\"text\":\"$${msg}\"}" fi - if [[ -n "$${discorduri}" ]]; then + if [[ $discorduri != "" ]]; then msg="$${sitename} DDNS Update Failed: $${record_name}: $${record_identifier} ($${CURRENT_IP})." ${pkgs.curl}/bin/curl -i -H "Accept: application/json" -H "Content-Type:application/json" -X POST --data-raw "{\"content\":\"$${msg}\"}" "$${discorduri}" fi @@ -700,10 +700,10 @@ in { *) msg="$${sitename} Updated: $${record_name}'s new IP Address is $${CURRENT_IP}" ${pkgs.util-linux}/bin/logger "DDNS Updater: $${CURRENT_IP} $${record_name} DDNS updated." - if [[ -n "$${slackuri}" ]]; then + if [[ $slackuri != "" ]]; then ${pkgs.curl}/bin/curl -L -X POST "$${slackuri}" --data-raw "{\"channel\":\"$${slackchannel}\",\"text\":\"$${msg}\"}" fi - if [[ -n "$${discorduri}" ]]; then + if [[ $discorduri != "" ]]; then ${pkgs.curl}/bin/curl -i -H "Accept: application/json" -H "Content-Type:application/json" -X POST --data-raw "{\"content\":\"$${msg}\"}" "$${discorduri}" fi exit 0;;