install.fairie/home/dot_ssh/run_onchanges_after_generate-public-keys.tmpl
Brian Zalewski e58f91cb9e Update 9 files
- /home/dot_local/bin/run_onchange_ensure-executable.tmpl
- /home/dot_local/share/ansible/run_onchange_after_symlink-ansible-configs.tmpl
- /home/dot_ssh/run_onchanges_after_ensure-private-key.tmpl
- /home/dot_ssh/run_onchanges_after_generate-public-keys.tmpl
- /home/Library/Fonts/run_onchange_after_add-fonts.tmpl
- /system/usr/share/run_onchange_after_setup-share-folder
- /system/usr/local/share/run_onchange_after_setup-share-folder
- /system/var/log/user/run_onchange_after-symlink-user-logs
- /system/etc/default/modify_grub
2022-12-25 09:09:00 +00:00

20 lines
627 B
Bash

#!/usr/bin/env bash
{{ $sshFiles := (output "find" (joinPath .chezmoi.homeDir ".ssh") "-type" "f") -}}
{{- range $sshFile := splitList "\n" $sshFiles -}}
{{- if ne $sshFile "" -}}
# {{ $sshFile }} hash: {{ $sshFile | sha256sum }}
{{ end -}}
{{- end }}
{{ includeTemplate "universal/profile" }}
{{ includeTemplate "universal/logg" }}
logg info 'Ensuring RSA public keys are present'
find "$HOME/.ssh" -type f | while read FILE; do
if [ ! -f "${FILE}" ] && cat "$FILE" | grep 'BEGIN RSA PRIVATE KEY'; then
logg info 'Generating missing public key for `'"$FILE"'`'
ssh-keygen -f "$FILE" -y > "${FILE}.pub"
fi
done