zshrc: solve ssh-agent shenenigans

This commit is contained in:
surtur 2022-10-17 20:56:53 +02:00
parent c9f2b2beed
commit 33282bf536
Signed by: wanderer
SSH Key Fingerprint: SHA256:MdCZyJ2sHLltrLBp0xQO0O1qTW9BT/xl5nXkDvhlMCI

18
.zshrc

@ -78,6 +78,7 @@
gitignore gitignore
golang golang
safe-paste safe-paste
ssh-agent
systemd systemd
terraform terraform
lol lol
@ -130,11 +131,13 @@
LANG=en_GB.UTF-8 LANG=en_GB.UTF-8
http_proxy="http://localhost:8118" http_proxy="http://localhost:8118"
if [ ! -S $HOME/.ssh/ssh_auth_sock ]; then if [ -z "$SSH_AUTH_SOCK" ]; then
eval `ssh-agent` > /dev/null eval `ssh-agent -s -t6h` > /dev/null
ln -sf "$SSH_AUTH_SOCK" $HOME/.ssh/ssh_auth_sock if [ ! -S $HOME/.ssh/ssh_auth_sock ]; then
ln -sf "$SSH_AUTH_SOCK" $HOME/.ssh/ssh_auth_sock
SSH_AUTH_SOCK=$HOME/.ssh/ssh_auth_sock
fi
fi fi
SSH_AUTH_SOCK=$HOME/.ssh/ssh_auth_sock
EDITOR='vim' EDITOR='vim'
@ -147,13 +150,6 @@
export DOCKER_HOST=unix://$XDG_RUNTIME_DIR/podman/podman.sock export DOCKER_HOST=unix://$XDG_RUNTIME_DIR/podman/podman.sock
if [ -z SSH_AGENT_PID ]; then
ssh-agent -s
if [ ! $(ssh-add -l | grep -q 'surtur (ED25519)') ]; then
agentssh
fi
fi
eval "$(starship init zsh)" eval "$(starship init zsh)"