[zsh] Move func/ directory to zsh/functions
This commit is contained in:
parent
91da2fc583
commit
7c08c5131f
53 changed files with 1 additions and 1 deletions
17
zsh/functions/connect_ssh_agent
Normal file
17
zsh/functions/connect_ssh_agent
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
#!/usr/bin/env zsh
|
||||
# Eryn Wells <eryn@erynwells.me>
|
||||
|
||||
function connect_ssh_agent
|
||||
{
|
||||
# Start SSH agent for password-less logins
|
||||
if [[ -z "$SSH_AUTH_SOCK" && -x "$SSHAGENT" ]]; then
|
||||
if ! pgrep -u $USER ssh-agent 1>/dev/null; then
|
||||
eval $(ssh-agent -s > ~/.ssh_agent_vars)
|
||||
trap "kill $SSH_AGENT_PID" 0
|
||||
else
|
||||
eval $(cat ~/.ssh_agent_vars)
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
connect_ssh_agent "$@"
|
||||
Loading…
Add table
Add a link
Reference in a new issue