From 574fc2d44c96160b9708476bea8a7ad731e68378 Mon Sep 17 00:00:00 2001 From: punkfairie <23287005+punkfairie@users.noreply.github.com> Date: Sun, 28 Apr 2024 17:08:40 -0700 Subject: [PATCH] Add .chezmoiscripts/00-backup-id_25519.fish --- .../run_once_before_00-backup-id_25519.fish.tmpl | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .chezmoiscripts/run_once_before_00-backup-id_25519.fish.tmpl diff --git a/.chezmoiscripts/run_once_before_00-backup-id_25519.fish.tmpl b/.chezmoiscripts/run_once_before_00-backup-id_25519.fish.tmpl new file mode 100644 index 0000000..2b9dcd1 --- /dev/null +++ b/.chezmoiscripts/run_once_before_00-backup-id_25519.fish.tmpl @@ -0,0 +1,13 @@ +#!/usr/bin/env fish + +{{ $sshDir := joinPath .chezmoi.homeDir ".ssh" -}} +{{ $pubKey := joinPath $sshDir "id_ed25519.pub" -}} +{{ $privKey := joinPath $sshDir "id_ed25519" -}} + +if test -e {{ $pubKey }} + mv {{ $pubKey }} {{ printf "%s%s" $pubKey ".bak" }} +end + +if test -e {{ $privKey }} + mv {{ $privKey }} {{ printf "%s%s" $privKey ".bak" }} +end