diff options
| author | Mitch Riedstra <mitch@riedstra.us> | 2019-04-08 01:34:14 -0400 |
|---|---|---|
| committer | Mitch Riedstra <mitch@riedstra.us> | 2019-04-08 01:34:14 -0400 |
| commit | c262cfc0b32711932e4e31597a26fcffe9fe5740 (patch) | |
| tree | 4b041cd1fb7f8706a1637b43f408e4ebb9498276 /mkshrc | |
| parent | eeea5cc2ba916dfbf439592c2e193d6e3d6ad5b3 (diff) | |
| download | dotfiles-c262cfc0b32711932e4e31597a26fcffe9fe5740.tar.gz dotfiles-c262cfc0b32711932e4e31597a26fcffe9fe5740.tar.xz | |
Make the checkSSHAgent function a little bit more robust
Diffstat (limited to 'mkshrc')
| -rw-r--r-- | mkshrc | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -368,7 +368,10 @@ checkSSHAgent() { if [ -e "$ssh_agent_conf" ] ; then . "$ssh_agent_conf" fi - if ! ps -eo pid | grep -q "$SSH_AGENT_PID" ; then + if ! ps -eo pid | grep -q "$SSH_AGENT_PID" \ + || ! [ -e "$ssh_agent_conf" ] \ + || [ -z "$SSH_AGENT_PID" ] ; \ + then ssh-agent -s | grep -v echo > "$ssh_agent_conf" . "$ssh_agent_conf" fi |
