mirror of
https://github.com/nikdoof/dotfiles.git
synced 2025-12-14 18:22:26 +00:00
Update Add-SshKey function in Windows and Linux
This commit is contained in:
14
bin/bin/add-sshkey
Normal file
14
bin/bin/add-sshkey
Normal file
@@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
TIMEOUT="1h"
|
||||
NAME=$1
|
||||
|
||||
if [ -z "$NAME" ]; then
|
||||
ssh-add -L
|
||||
else
|
||||
if [ -f "~/.ssh/id_ed25519_${NAME}" ]; then
|
||||
ssh-add -t $TIMEOUT "~/.ssh/id_ed25519_${NAME}"
|
||||
else
|
||||
echo "No key named ${NAME} found..."
|
||||
fi
|
||||
fi
|
||||
Reference in New Issue
Block a user