From e445e1a32164a7ab52bc10b792840d12e8541672 Mon Sep 17 00:00:00 2001 From: Brian Zalewski Date: Fri, 25 Nov 2022 06:23:11 +0000 Subject: [PATCH] Update dotfiles/.config/age/run_once_before_decrypt-private-key.sh.tmpl --- .../age/run_once_before_decrypt-private-key.sh.tmpl | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/dotfiles/.config/age/run_once_before_decrypt-private-key.sh.tmpl b/dotfiles/.config/age/run_once_before_decrypt-private-key.sh.tmpl index 45207ab2..9173cc21 100644 --- a/dotfiles/.config/age/run_once_before_decrypt-private-key.sh.tmpl +++ b/dotfiles/.config/age/run_once_before_decrypt-private-key.sh.tmpl @@ -5,7 +5,9 @@ if [ ! -f "$HOME/.config/age/headless.txt" ]; then age-keygen > "$HOME/.config/age/headless.txt" fi -if [ ! -f "$HOME/.config/age/key.txt" ]; then - age --decrypt --output "$HOME/.config/age/key.txt" "{{ .chezmoi.sourceDir }}/key.txt.age" - chmod 600 "${HOME}/key.txt" +if [ -f "{{ .chezmoi.sourceDir }}/key.txt.age" ]; then + # TODO + logg 'Decrypting' + age --decrypt --output "$HOME/.config/age/key.txt" "{{ .chezmoi.sourceDir }}/key.txt.age" + chmod 600 "$HOME/.config/age/key.txt" fi