From fc2a78b0db08f1d8c23d5324d85aa9423f454d9f Mon Sep 17 00:00:00 2001 From: Nettika Date: Sat, 30 Nov 2024 13:37:00 -0800 Subject: [PATCH] Fix DNS updater --- hosts/monolith/dns.nix | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/hosts/monolith/dns.nix b/hosts/monolith/dns.nix index 24d8823..5cff952 100755 --- a/hosts/monolith/dns.nix +++ b/hosts/monolith/dns.nix @@ -3,22 +3,16 @@ systemd.services.update-dns = { serviceConfig.Type = "oneshot"; description = "Update the leaf.ninja DNS records"; - path = with pkgs; [ curl jq ]; + path = with pkgs; [ curl ]; script = '' public_ip=$(curl -s https://ifconfig.me/ip) endpoint="https://api.gandi.net/v5/livedns/domains/leaf.ninja/records" - curl -s \ + curl \ -X PUT \ -H "Authorization: Bearer ${secrets.gandi.token}" \ -H "Content-Type: application/json" \ -d "{\"rrset_values\":[\"$public_ip\"]}" \ - "$ENDPOINT/%2A/A" | jq - curl -s \ - -X PUT \ - -H "Authorization: Bearer ${secrets.gandi.token}" \ - -H "Content-Type: application/json" \ - -d "{\"rrset_values\":[\"$public_ip\"]}" \ - "$ENDPOINT/%40/A" | jq + $endpoint/ostiary/A ''; };