aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMitch Riedstra <mitch@riedstra.us>2019-02-19 00:07:42 -0500
committerMitch Riedstra <mitch@riedstra.us>2019-02-19 00:07:42 -0500
commitf69fa3387a1a6f20edd301bda8f9c8cc00cf5aea (patch)
treea23c99605c47211019581c33543b6217e746b911
parent3d13aa96405f096e91a7ca279991046484b53e00 (diff)
downloaddotfiles-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--mkshrc10
1 files changed, 10 insertions, 0 deletions
diff --git a/mkshrc b/mkshrc
index 36c37d8..758313d 100644
--- a/mkshrc
+++ b/mkshrc
@@ -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=""