Update .local/share/chezmoi/home/dot_ssh/run_onchanges_after_generate-public-keys.tmpl

This commit is contained in:
Brian Zalewski 2022-12-05 19:45:18 +00:00
parent b9ba477155
commit ca3430f750

View file

@ -10,11 +10,11 @@
{{- includeTemplate "universal/profile" }} {{- includeTemplate "universal/profile" }}
{{- includeTemplate "universal/logg" }} {{- includeTemplate "universal/logg" }}
logg 'Ensuring RSA public keys are present' logg info 'Ensuring RSA public keys are present'
find "$HOME/.ssh" -type f | while read FILE; do find "$HOME/.ssh" -type f | while read FILE; do
if [ ! -f "${FILE}" ] && cat "$FILE" | grep 'BEGIN RSA PRIVATE KEY'; then if [ ! -f "${FILE}" ] && cat "$FILE" | grep 'BEGIN RSA PRIVATE KEY'; then
logg '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"
fi fi
done done