This commit is contained in:
Brian Zalewski 2023-03-20 05:47:35 -04:00
parent 1143707b48
commit 2b1caba409
2 changed files with 2 additions and 2 deletions

View file

@ -5,7 +5,7 @@
{{ includeTemplate "universal/logg" }} {{ includeTemplate "universal/logg" }}
logg info 'Decrypting SSH keys stored in the `home/.chezmoitemplates/ssh` folder of the Install Doctor repo / fork.' logg info 'Decrypting SSH keys stored in the `home/.chezmoitemplates/ssh` folder of the Install Doctor repo / fork.'
find "{{ .chezmoi.sourceDir }}/.chezmoitemplates/ssh" -type f -maxdepth 1 ! -name "*.pub" ! -name "authorized_keys*" ! -name "known_host*" ! -name "config" | while read SSH_FILE; do find "{{ .chezmoi.sourceDir }}/.chezmoitemplates/ssh" -type f | while read SSH_FILE; do
### Decrypt SSH file with Chezmoi ### Decrypt SSH file with Chezmoi
logg info 'Decrypting the $(basename "$SSH_FILE") encrypted SSH file' logg info 'Decrypting the $(basename "$SSH_FILE") encrypted SSH file'
chezmoi decrypt "$SSH_FILE" > "$HOME/.ssh/$(basename "$SSH_FILE")" || EXIT_CODE=$? chezmoi decrypt "$SSH_FILE" > "$HOME/.ssh/$(basename "$SSH_FILE")" || EXIT_CODE=$?

View file

@ -12,7 +12,7 @@
logg info 'Ensuring public keys are present' logg info 'Ensuring public keys are present'
find "$HOME/.ssh" -type f | while read FILE; do find "$HOME/.ssh" -maxdepth 1 ! -name "*.pub" ! -name "authorized_keys*" ! -name "known_host*" ! -name "config" | while read FILE; do
if [ ! -f "${FILE}.pub" ]; then if [ ! -f "${FILE}.pub" ]; then
logg info 'Generating missing public key for `'"$FILE"'`' logg info 'Generating missing public key for `'"$FILE"'`'
ssh-keygen -f "$FILE" -y > "${FILE}.pub" ssh-keygen -f "$FILE" -y > "${FILE}.pub"