13 lines
398 B
Bash
13 lines
398 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 --decrypt --output "$HOME/.config/age/key.txt" "{{ .chezmoi.sourceDir }}/key.txt.age"
|
|
chmod 600 "$HOME/.config/age/key.txt"
|
|
fi
|