Skip to content

Instantly share code, notes, and snippets.

@jdeluyck
Forked from x-drum/ssh-agent-shutdown.sh
Created May 17, 2022 16:43
Show Gist options
  • Save jdeluyck/1831f6b96c7f1cbe7d949132138738bd to your computer and use it in GitHub Desktop.
Save jdeluyck/1831f6b96c7f1cbe7d949132138738bd to your computer and use it in GitHub Desktop.
ssh-agent: Archlinux plasma 5
#!/bin/sh
## place in ~/.config/plasma-workspace/shutdown/ssh-agent-shutdown.sh
## exec order: "kde shutdown"
$SSH_AGENT_PID" ] || eval "$(ssh-agent -k)"
#/bin/bash
## place in ~/.config/plasma-workspace/env/ssh-agent-sshadd.sh
ssh-add </dev/null
## uncomment if you intend to add multiple ssh keys
# ssh-add $HOME/.ssh/key1 $HOME/.ssh/key2 $HOME/.ssh/key3 </dev/null
#/bin/bash
## place in ~/.config/plasma-workspace/env/ssh-agent-startup.sh
## exec order: "kde pre-startup"
export SSH_ASKPASS="/usr/bin/ksshaskpass"
if ! pgrep -u $USER ssh-agent > /dev/null; then
ssh-agent > ~/.ssh-agent-thing
fi
if [[ "$SSH_AGENT_PID" == "" ]]; then
eval $(<~/.ssh-agent-thing)
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment