diff options
| author | Franck Cuny <franck@fcuny.net> | 2023-05-05 19:41:58 -0700 |
|---|---|---|
| committer | Franck Cuny <franck@fcuny.net> | 2023-05-05 19:41:58 -0700 |
| commit | 43da9edb4598eef509c481ae0b305384418c45de (patch) | |
| tree | a0ad614c90102757143e026e4fe1806431a3dbf4 /home/shell/fish/functions/find-ssh-agent.fish | |
| parent | profiles/default: users are immutable (diff) | |
| download | infra-43da9edb4598eef509c481ae0b305384418c45de.tar.gz | |
home/profiles: move (almost) all modules to profiles
This is a major refactor, similar to what was done for the hosts, but in
a single commit.
Diffstat (limited to '')
| -rw-r--r-- | home/shell/fish/functions/find-ssh-agent.fish | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/home/shell/fish/functions/find-ssh-agent.fish b/home/shell/fish/functions/find-ssh-agent.fish deleted file mode 100644 index 9e2de8d..0000000 --- a/home/shell/fish/functions/find-ssh-agent.fish +++ /dev/null @@ -1,20 +0,0 @@ -function find-ssh-agent --description "find or run ssh-agent" - # let's avoid storing the agent's socket under /tmp - set -l ssh_auth_sock $XDG_RUNTIME_DIR/ssh-agent.sock - - if set -q SSH_AGENT_PID; and set -q SSH_AUTH_SOCK - # if variables already defined, then try to connect to agent - ssh-add -l &>/dev/null - test $status -ne 2; and return - end - - set -l user_id (id -u) - set -l ssh_agent_pid (pgrep --exact --newest --uid $user_id ssh-agent) - - if test -S $ssh_auth_sock - set --global --export SSH_AUTH_SOCK $ssh_auth_sock - set --global --export SSH_AGENT_PID $ssh_agent_pid - else - eval (ssh-agent -c -a $ssh_auth_sock) - end -end |
