mirror of
https://github.com/dcarrillo/prezto.git
synced 2024-12-22 16:18:00 +00:00
ssh: check ssh-askpass presence under Linux
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
This commit is contained in:
parent
3f556400e7
commit
7b5196ca66
@ -39,10 +39,11 @@ fi
|
|||||||
# Load identities.
|
# Load identities.
|
||||||
if ssh-add -l 2>&1 | grep -q 'The agent has no identities'; then
|
if ssh-add -l 2>&1 | grep -q 'The agent has no identities'; then
|
||||||
zstyle -a ':prezto:module:ssh:load' identities '_ssh_identities'
|
zstyle -a ':prezto:module:ssh:load' identities '_ssh_identities'
|
||||||
if (( ${#_ssh_identities} > 0 )); then
|
# Check for Linux system and ssh-askpass presence
|
||||||
ssh-add "$_ssh_dir/${^_ssh_identities[@]}" < /dev/null 2> /dev/null
|
if [[ "$OSTYPE" == linux* ]] && [[ ! -a /usr/lib/ssh/x11-ssh-askpass ]]; then
|
||||||
|
ssh-add "${_ssh_identities:+$_ssh_dir/${^_ssh_identities[@]}}" 2> /dev/null
|
||||||
else
|
else
|
||||||
ssh-add < /dev/null 2> /dev/null
|
ssh-add "${_ssh_identities:+$_ssh_dir/${^_ssh_identities[@]}}" < /dev/null 2> /dev/null
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user