dc2c74a2b1
Deleted dotfiles/.local/share/chezmoi/home/dot_ssh/id_rsa.pub
15 lines
509 B
Bash
15 lines
509 B
Bash
#!/usr/bin/env bash
|
|
|
|
{{ $sshFiles = (output "find" "$HOME/.ssh" "-type" "f") }}
|
|
{{ range $sshFile := $sshFiles }}
|
|
# .ssh hash: {{ include ".ssh" | sha256sum }}
|
|
# {{ $sshFile }} hash: {{ include $sshFile | sha256sum }}
|
|
{{ end }}
|
|
|
|
logg '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 'Generating missing public key for `'"$FILE"'`'
|
|
ssh-keygen -f "$FILE" -y > "${FILE}.pub"
|
|
fi
|
|
done
|