diff options
| author | Mitch Riedstra <mitch@riedstra.us> | 2019-02-19 00:07:42 -0500 |
|---|---|---|
| committer | Mitch Riedstra <mitch@riedstra.us> | 2019-02-19 00:07:42 -0500 |
| commit | f69fa3387a1a6f20edd301bda8f9c8cc00cf5aea (patch) | |
| tree | a23c99605c47211019581c33543b6217e746b911 | |
| parent | 3d13aa96405f096e91a7ca279991046484b53e00 (diff) | |
| download | dotfiles-f69fa3387a1a6f20edd301bda8f9c8cc00cf5aea.tar.gz dotfiles-f69fa3387a1a6f20edd301bda8f9c8cc00cf5aea.tar.xz | |
Add a check to see if the SSH agent is running, if not start it and write the environment settings to a predictable location
| -rw-r--r-- | mkshrc | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -358,6 +358,16 @@ timestamp() { date +%m.%d.%y_%H.%M.%S } +checkSSHAgent() { + ssh_agent_conf="$HOME/.ssh/agent" + if [ -e "$ssh_agent_conf" ] ; then + . "$ssh_agent_conf" + fi + if ! ps -eo pid | grep -q "$SSH_AGENT_PID" ; then + ssh-agent -s | grep -v echo > "$ssh_agent_conf" + . "$ssh_agent_conf" + fi +} pull() { url="" |
