11 lines
580 B
Cheetah
11 lines
580 B
Cheetah
|
{{- if ( bitwarden "item" "dev.betelgeuse.ssh.personal.id_rsa.private" ).notes -}}
|
||
|
{{- ( bitwarden "item" "dev.betelgeuse.ssh.personal.id_rsa.private" ).notes -}}
|
||
|
{{- else -}}
|
||
|
{{- $sshLocation = (joinPath .chezmoi.homeDir ".ssh" "id_rsa") -}}
|
||
|
{{- if not (stat $sshLocation) -}}
|
||
|
{{- $sshKeygen = (output "ssh-keygen" "-b" "4096" "-t" "rsa" "-f" $sshLocation "-q" "-N" }}
|
||
|
{{- writeToStdout "Generated new SSH key since none were present and could not connect to BitWarden. It will be encrypted and included in your source." -}}
|
||
|
{{- end -}}
|
||
|
{{- include $sshLocation }}
|
||
|
{{ end }}
|