Skip to content

Commit c833255

Browse files
committed
fix copy ssh key
1 parent 238ed65 commit c833255

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

bash/ssh/ssh_copy_key.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
export KEY_NAME="id_ed25519"
55

66
if [ -d /Applications ]; then
7-
pbcopy < ~/.ssh/id_rsa.pub # copies key to clipboard
7+
pbcopy < ~/.ssh/$KEY_NAME.pub # copies key to clipboard
88
elif [ -d /c ]; then
9-
cat ~/.ssh/id_rsa.pub | clip # copies key to clipboard
9+
cat ~/.ssh/$KEY_NAME.pub | clip # copies key to clipboard
1010
else
1111
xclip -sel clip < ~/.ssh/$KEY_NAME.pub
1212
fi

bash/ssh/ssh_copy_key_old.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
# copy ssh key
3+
4+
export KEY_NAME="id_rsa"
5+
6+
if [ -d /Applications ]; then
7+
pbcopy < ~/.ssh/$KEY_NAME.pub # copies key to clipboard
8+
elif [ -d /c ]; then
9+
cat ~/.ssh/$KEY_NAME.pub | clip # copies key to clipboard
10+
else
11+
xclip -sel clip < ~/.ssh/$KEY_NAME.pub
12+
fi

0 commit comments

Comments
 (0)