From ef27674c4e2613e60bcb1e191030bd89f22f1bd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakobus=20Sch=C3=BCrz?= Date: Thu, 24 Sep 2020 13:15:16 +0200 Subject: [PATCH] add token to bash_completion --- .../{ssh-agent-start-or-restart => sshagentactions} | 2 +- bin/startagent | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) rename bash_completion.d/{ssh-agent-start-or-restart => sshagentactions} (88%) diff --git a/bash_completion.d/ssh-agent-start-or-restart b/bash_completion.d/sshagentactions similarity index 88% rename from bash_completion.d/ssh-agent-start-or-restart rename to bash_completion.d/sshagentactions index 72f7f15..54f19ec 100644 --- a/bash_completion.d/ssh-agent-start-or-restart +++ b/bash_completion.d/sshagentactions @@ -10,5 +10,5 @@ function _sshidentities() { COMPREPLY=( $(compgen -W "${KEYS}" -- ${CUR}) ) return 0 } -complete -F _sshidentities startagent loadagent +complete -F _sshidentities startagent loadagent token diff --git a/bin/startagent b/bin/startagent index 53fce93..f73bcaa 100755 --- a/bin/startagent +++ b/bin/startagent @@ -134,14 +134,14 @@ agent-start-or-restart () { logwarn "$msg" ;; 2) - loginfo "former agent is not running" >&2 + loginfo "former agent is not running -> start it" >&2 [ -e $agentsocket ] && { logdebug -n "remove socketfile: $( rm -v "$agentsocket" )"; } logdebug "$(ssh-agent -a $agentsocket ${SSH_AGENT_OPTIONS} > $agentfile )" loginfo "agent started" >&2 ;; esac else - loginfo "agent did not exist" >&2 + loginfo "agent did not exist -> create it" >&2 #rm "$agentsocket" logdebug "ssh-agent -a $agentsocket \> $agentfile" logdebug "$(ssh-agent -a $agentsocket $SSH_AGENT_OPTIONS > $agentfile )" @@ -149,12 +149,12 @@ agent-start-or-restart () { fi fi - logdebug "agent for $ssh_identity: $agentfile" + logdebug "ssh-agent for identity »$ssh_identity«: $agentfile" $createonly && logdebug "current loaded keys: $(ssh-runinagent $agentfile ssh-add -l)" echo $agentfile ret=0 else - logwarn "ssh-identity $ssh_identity is not configured. Please create $identitydir and add keys" + logwarn "ssh-identity »$ssh_identity« is not configured. Please create $identitydir and add keys" ret=2 fi