13 lines
406 B
Bash
13 lines
406 B
Bash
#!/bin/sh
|
|
|
|
if [ ! -f "$HOME/.config/age/headless.txt" ]; then
|
|
logg 'Generating age public key under `~/.config/age/key.txt`'
|
|
age-keygen > "$HOME/.config/age/headless.txt"
|
|
fi
|
|
|
|
if [ -f "{{ .chezmoi.sourceDir }}/key.txt.age" ]; then
|
|
# TODO
|
|
logg 'Decrypting age key'
|
|
age --decrypt --output "$HOME/.config/age/key.txt" "{{ .chezmoi.sourceDir }}/key.txt.age"
|
|
chmod 600 "$HOME/.config/age/key.txt"
|
|
fi
|