✨ Add pubkey copy function
This commit is contained in:
parent
78e7146414
commit
b2340ad07d
1 changed files with 11 additions and 0 deletions
11
fish/.config/fish/functions/cpkey.fish.symlink
Normal file
11
fish/.config/fish/functions/cpkey.fish.symlink
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
#!/usr/bin/env fish
|
||||||
|
|
||||||
|
function cpkey -d "Copy the id_rsa public key to clipboard, generating the keypair if needed"
|
||||||
|
if ! [ -O "~/.ssh/id_rsa.pub" ]
|
||||||
|
echo "=> Generating id_rsa keypair..."
|
||||||
|
ssh-keygen -f "~/.ssh/id_rsa"
|
||||||
|
end
|
||||||
|
|
||||||
|
more "~/.ssh/id_rsa.pub" | pbcopy
|
||||||
|
echo "=> Public key copied to clipbard"
|
||||||
|
end
|
Loading…
Reference in a new issue