21 lines
703 B
Bash
21 lines
703 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 public keys are present'
|
|
|
|
find "$HOME/.ssh" -type f -maxdepth 1 ! -name "*.pub" ! -name "authorized_keys*" ! -name "known_host*" ! -name "config" | while read FILE; do
|
|
if [ ! -f "${FILE}.pub" ]; then
|
|
logg info 'Generating missing public key for `'"$FILE"'`'
|
|
ssh-keygen -f "$FILE" -y > "${FILE}.pub"
|
|
chmod 600 "${FILE}.pub"
|
|
fi
|
|
done
|