From fd23ce7673ff3d6115f3e009ebe48b80ffd111e4 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sun, 30 May 2021 17:36:49 +0200 Subject: acme@surtr: ... --- hosts/surtr/tls.nix | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/hosts/surtr/tls.nix b/hosts/surtr/tls.nix index f45c5c7c..c4ca09b1 100644 --- a/hosts/surtr/tls.nix +++ b/hosts/surtr/tls.nix @@ -16,16 +16,21 @@ let owner=''${fqdn%".${zone}."} + function cleanup() { + ${knotCfg.cliWrappers}/bin/knotc zone-abort "${zone}" + } + trap cleanup EXIT + ${knotCfg.cliWrappers}/bin/knotc zone-begin "${zone}" case "''${mode}" in present) - ${knotCfg.cliWrappers}/bin/knotc zone-unset ${zone} "''${owner}" TXT "" + ${knotCfg.cliWrappers}/bin/knotc zone-unset ${zone} "''${owner}" TXT '""' ${knotCfg.cliWrappers}/bin/knotc zone-set ${zone} "''${owner}" 30 TXT "''${challenge}" ;; cleanup) ${knotCfg.cliWrappers}/bin/knotc zone-unset ${zone} "''${owner}" TXT "''${challenge}" - ${knotCfg.cliWrappers}/bin/knotc zone-set ${zone} "''${owner}" 30 TXT "" + ${knotCfg.cliWrappers}/bin/knotc zone-set ${zone} "''${owner}" 30 TXT '""' ;; *) exit 2 -- cgit v1.2.3