print agentfile also for no given identity

This commit is contained in:
Jakobus Schürz 2023-06-29 15:02:14 +02:00
parent 23ab92c2cb
commit e46bbc6868

View file

@ -194,12 +194,10 @@ $(ssh_runinagent $agentfile ssh-add -l)"
ret=0 ret=0
else else
logwarning "ssh-identity »$ssh_identity« is not configured. Please create $identitydir and add keys" logwarning "ssh-identity »$ssh_identity« is not configured. Please create $identitydir and add keys"
echo $agentfile printf "%s" "$agentfile"
ret=2 ret=2
fi fi
else else
if which gnome-keyring-daemon >/dev/null 2>&1; then if which gnome-keyring-daemon >/dev/null 2>&1; then
logdebug "no identity given -> gnome-keyrings ssh-agent" logdebug "no identity given -> gnome-keyrings ssh-agent"
agentfile="${SSH_AGENTS_DIR}/agent-gnome_session-$(hostname)" agentfile="${SSH_AGENTS_DIR}/agent-gnome_session-$(hostname)"
@ -209,12 +207,12 @@ $(ssh_runinagent $agentfile ssh-add -l)"
logdebug "ssh-agent for identity »$ssh_identity«: $agentfile" logdebug "ssh-agent for identity »$ssh_identity«: $agentfile"
# logdebug "currently loaded keys after action: # logdebug "currently loaded keys after action:
#$(ssh_runinagent $agentfile ssh-add -l)" #$(ssh_runinagent $agentfile ssh-add -l)"
printf "%s" "$agentfile"
ret=0 ret=0
else else
logwarning "no identity given -> exit" logwarning "no identity given -> exit"
ret=1 ret=1
fi fi
fi fi
[ $DISPLAY_ORIG ] && logtrace "reset DISPLAY=$DISPLAY_ORIG" [ $DISPLAY_ORIG ] && logtrace "reset DISPLAY=$DISPLAY_ORIG"
@ -373,7 +371,8 @@ function check_pubkeysonly () {
ssh_runinagent () { ssh_runinagent () {
local SSH_AUTH_SOCK
local SSH_AGENT_PID
local agentfile local agentfile
local command local command
local agentfile=${1} local agentfile=${1}