mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-04-10 04:26:17 +02:00
add quiet option to ssh-agent plugin
allows to switch off output and addition of ssh identities
This commit is contained in:
parent
22632aac7c
commit
5d924b2e04
1 changed files with 15 additions and 5 deletions
|
|
@ -18,6 +18,12 @@
|
||||||
#
|
#
|
||||||
# zstyle :omz:plugins:ssh-agent lifetime 4h
|
# zstyle :omz:plugins:ssh-agent lifetime 4h
|
||||||
#
|
#
|
||||||
|
# To make the plugin not ouput anything use the quiet style.
|
||||||
|
# This prevents ouput messages and ssh-add, which might ask
|
||||||
|
# for a passphrase.
|
||||||
|
#
|
||||||
|
# zstyle :omz:plugins:ssh-agent quiet yes
|
||||||
|
#
|
||||||
# CREDITS
|
# CREDITS
|
||||||
#
|
#
|
||||||
# Based on code from Joseph M. Reagle
|
# Based on code from Joseph M. Reagle
|
||||||
|
|
@ -32,7 +38,6 @@ local _plugin__forwarding
|
||||||
|
|
||||||
function _plugin__start_agent()
|
function _plugin__start_agent()
|
||||||
{
|
{
|
||||||
local -a identities
|
|
||||||
local lifetime
|
local lifetime
|
||||||
zstyle -s :omz:plugins:ssh-agent lifetime lifetime
|
zstyle -s :omz:plugins:ssh-agent lifetime lifetime
|
||||||
|
|
||||||
|
|
@ -41,11 +46,16 @@ function _plugin__start_agent()
|
||||||
chmod 600 ${_plugin__ssh_env}
|
chmod 600 ${_plugin__ssh_env}
|
||||||
. ${_plugin__ssh_env} > /dev/null
|
. ${_plugin__ssh_env} > /dev/null
|
||||||
|
|
||||||
# load identies
|
local quiet
|
||||||
zstyle -a :omz:plugins:ssh-agent identities identities
|
zstyle -b :omz:plugins:ssh-agent quiet quiet
|
||||||
echo starting ssh-agent...
|
if [[ ! ${quiet} == "yes" ]]; then
|
||||||
|
local -a identities
|
||||||
|
# load identities
|
||||||
|
zstyle -a :omz:plugins:ssh-agent identities identities
|
||||||
|
echo starting ssh-agent...
|
||||||
|
|
||||||
/usr/bin/ssh-add $HOME/.ssh/${^identities}
|
/usr/bin/ssh-add $HOME/.ssh/${^identities}
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Get the filename to store/lookup the environment from
|
# Get the filename to store/lookup the environment from
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue