Skip to content

Commit

Permalink
ssh: check ssh-askpass presence under Linux
Browse files Browse the repository at this point in the history
Check the presence of `ssh-askpass`, if `/usr/lib/ssh/x11-ssh-askpass`
is present I use it otherwise I require the passphrase in the standard
method
  • Loading branch information
crivotz authored and indrajitr committed Aug 1, 2017
1 parent 3f55640 commit 7b5196c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions modules/ssh/init.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,11 @@ fi
# Load identities.
if ssh-add -l 2>&1 | grep -q 'The agent has no identities'; then
zstyle -a ':prezto:module:ssh:load' identities '_ssh_identities'
if (( ${#_ssh_identities} > 0 )); then
ssh-add "$_ssh_dir/${^_ssh_identities[@]}" < /dev/null 2> /dev/null
# Check for Linux system and ssh-askpass presence
if [[ "$OSTYPE" == linux* ]] && [[ ! -a /usr/lib/ssh/x11-ssh-askpass ]]; then
ssh-add "${_ssh_identities:+$_ssh_dir/${^_ssh_identities[@]}}" 2> /dev/null
else
ssh-add < /dev/null 2> /dev/null
ssh-add "${_ssh_identities:+$_ssh_dir/${^_ssh_identities[@]}}" < /dev/null 2> /dev/null
fi
fi

Expand Down

0 comments on commit 7b5196c

Please sign in to comment.