Skip to content

Commit

Permalink
Update start
Browse files Browse the repository at this point in the history
  • Loading branch information
bernardolm committed Nov 10, 2023
1 parent 00b4b6d commit 503c885
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions ssh/start
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,26 @@

log start "ssh setup"

command -v keychain &>/dev/null || sudo apt install -y keychain >/dev/null
log info "authenticating ssh..."
eval $(keychain --eval id_ed25519)
# command -v keychain &>/dev/null || sudo apt install -y keychain >/dev/null
# log info "authenticating ssh..."
# eval $(keychain --eval id_ed25519)

#-----------------------–----------------------------

# ssh-add /home/$USER/.ssh/id_ed25519

#-----------------------–----------------------------

# ref.: https://code.visualstudio.com/docs/remote/troubleshooting

if [ -z "$SSH_AUTH_SOCK" ]; then
# Check for a currently running instance of the agent
RUNNING_AGENT="`ps -ax | grep 'ssh-agent -s' | grep -v grep | wc -l | tr -d '[:space:]'`"
if [ "$RUNNING_AGENT" = "0" ]; then
# Launch a new instance of the agent
ssh-agent -s &> .ssh/ssh-agent
fi
eval `cat .ssh/ssh-agent`
fi

log finish "ssh setup"

0 comments on commit 503c885

Please sign in to comment.