Fix and quiet ssh identity initialization
It looks like some of the variables were incorrectly named. I also quieted down the grep command. Not sure about redirecting ssh-add to /dev/null though. It would prevent any actual errors from being shown.
This commit is contained in:
parent
16aa48baeb
commit
54e172023c
1 changed files with 4 additions and 5 deletions
|
@ -28,12 +28,12 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Load identities.
|
# Load identities.
|
||||||
if ssh-add -l 2>&1 | grep '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 (( ${#identities} > 0 )); then
|
if (( ${#_ssh_identities} > 0 )); then
|
||||||
ssh-add "$_ssh_dir/${^_ssh_identities[@]}"
|
ssh-add "$_ssh_dir/${^_ssh_identities[@]}" 2> /dev/null
|
||||||
else
|
else
|
||||||
ssh-add
|
ssh-add 2> /dev/null
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -45,4 +45,3 @@ fi
|
||||||
|
|
||||||
# Clean up.
|
# Clean up.
|
||||||
unset _ssh_{dir,identities} _ssh_agent_{env,sock}
|
unset _ssh_{dir,identities} _ssh_agent_{env,sock}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue