diff options
Diffstat (limited to 'hosts/surtr/tls.nix')
-rw-r--r-- | hosts/surtr/tls.nix | 9 |
1 files 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 | |||
16 | 16 | ||
17 | owner=''${fqdn%".${zone}."} | 17 | owner=''${fqdn%".${zone}."} |
18 | 18 | ||
19 | function cleanup() { | ||
20 | ${knotCfg.cliWrappers}/bin/knotc zone-abort "${zone}" | ||
21 | } | ||
22 | trap cleanup EXIT | ||
23 | |||
19 | ${knotCfg.cliWrappers}/bin/knotc zone-begin "${zone}" | 24 | ${knotCfg.cliWrappers}/bin/knotc zone-begin "${zone}" |
20 | 25 | ||
21 | case "''${mode}" in | 26 | case "''${mode}" in |
22 | present) | 27 | present) |
23 | ${knotCfg.cliWrappers}/bin/knotc zone-unset ${zone} "''${owner}" TXT "" | 28 | ${knotCfg.cliWrappers}/bin/knotc zone-unset ${zone} "''${owner}" TXT '""' |
24 | ${knotCfg.cliWrappers}/bin/knotc zone-set ${zone} "''${owner}" 30 TXT "''${challenge}" | 29 | ${knotCfg.cliWrappers}/bin/knotc zone-set ${zone} "''${owner}" 30 TXT "''${challenge}" |
25 | ;; | 30 | ;; |
26 | cleanup) | 31 | cleanup) |
27 | ${knotCfg.cliWrappers}/bin/knotc zone-unset ${zone} "''${owner}" TXT "''${challenge}" | 32 | ${knotCfg.cliWrappers}/bin/knotc zone-unset ${zone} "''${owner}" TXT "''${challenge}" |
28 | ${knotCfg.cliWrappers}/bin/knotc zone-set ${zone} "''${owner}" 30 TXT "" | 33 | ${knotCfg.cliWrappers}/bin/knotc zone-set ${zone} "''${owner}" 30 TXT '""' |
29 | ;; | 34 | ;; |
30 | *) | 35 | *) |
31 | exit 2 | 36 | exit 2 |