From ab62941eb3c327e4b37587c1f5a005eefc21f5c9 Mon Sep 17 00:00:00 2001 From: Alexander Bantyev Date: Sun, 12 Sep 2021 20:14:11 +0300 Subject: [PATCH] Keep secrets when decryption is impossible --- modules/secrets.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/secrets.nix b/modules/secrets.nix index 7702367..eda5a16 100755 --- a/modules/secrets.nix +++ b/modules/secrets.nix @@ -65,7 +65,12 @@ let else echo "Failed to decrypt the secret" rm '${decrypted}.tmp' - exit 1 + if [[ -f '${decrypted}' ]]; then + echo "The decrypted file exists anyways, not failing" + exit 0 + else + exit 1 + fi fi '';