Fix SSH agent detection

This commit is contained in:
Anthony Rose 2022-08-25 11:31:58 +01:00
parent 1a2a9054e5
commit 4edb07531c

View file

@ -3,6 +3,11 @@ if [ -n "$_acp_ignore_shrc" ]
then then
return 1 return 1
fi fi
if [ -n "$_acp_shrc_loaded" ]
then
return 1
fi
export _acp_shrc_loaded=1
case "$-" in case "$-" in
*i*) *i*)
@ -152,11 +157,14 @@ fi
alias prun='podman run --rm --interactive --tty --security-opt label=disable --volume "$HOME":"$HOME" --volume "$XDG_RUNTIME_DIR":"$XDG_RUNTIME_DIR" --env XDG_RUNTIME_DIR="$XDG_RUNTIME_DIR" --env XDG_SESSION_TYPE=wayland --ipc host' alias prun='podman run --rm --interactive --tty --security-opt label=disable --volume "$HOME":"$HOME" --volume "$XDG_RUNTIME_DIR":"$XDG_RUNTIME_DIR" --env XDG_RUNTIME_DIR="$XDG_RUNTIME_DIR" --env XDG_SESSION_TYPE=wayland --ipc host'
alias pruncerts='prun --volume /etc/pki/ca-trust:/etc/pki/ca-trust:ro --volume /etc/ssl/certs:/etc/ssl/certs:ro' alias pruncerts='prun --volume /etc/pki/ca-trust:/etc/pki/ca-trust:ro --volume /etc/ssl/certs:/etc/ssl/certs:ro'
if command -v ssh-agent > /dev/null && [ -z "$SSH_AUTH_SOCK" ] && [ -z "$SSH_AGENT_PID" ] if command -v ssh-agent > /dev/null
then then
export SSH_AUTH_SOCK="$XDG_STATE_HOME/ssh-agent.socket" export SSH_AUTH_SOCK="${SSH_AUTH_SOCK:-$XDG_STATE_HOME/ssh-agent.socket}"
export SSH_AGENT_PID="$XDG_STATE_HOME/ssh-agent.pid" export SSH_AGENT_PID="${SSH_AGENT_PID:-$XDG_STATE_HOME/ssh-agent.pid}"
ssh-agent -a "$SSH_AUTH_SOCK" if [ ! -S "$SSH_AUTH_SOCK" ]
then
ssh-agent -a "$SSH_AUTH_SOCK"
fi
fi fi
mkcd () { mkcd () {