Skip to content

Commit 986290c

Browse files
author
Chris Blackburn
committed
Init ssh-agent if not running
1 parent dac622a commit 986290c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

plugins/ssh/ssh.plugin.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
KEYS=`ls -1 ~/.ssh/id_* | grep -v ".pub"`
44

5+
# Initialize ssh-agent if not running
6+
pgrep -fx ssh-agent
7+
if [ $? -ne 0 ]; then
8+
eval "$(ssh-agent)"
9+
fi
10+
511
for k in $KEYS ; do
612
ssh-add "$k"
713
done

0 commit comments

Comments
 (0)