summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--zsh/.zshrc34
1 files changed, 29 insertions, 5 deletions
diff --git a/zsh/.zshrc b/zsh/.zshrc
index 9f9aaf2..5f0bbe2 100644
--- a/zsh/.zshrc
+++ b/zsh/.zshrc
@@ -30,6 +30,30 @@ ZDIR=~/.zsh/
_HOST_TYPE=$(uname)
# #############################################################################
+# ssh-agent
+# #############################################################################
+
+SSH_ENV="$HOME/.ssh/environment"
+
+function start_agent {
+ echo "Initialising new SSH agent..."
+ /usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}"
+ echo succeeded
+ chmod 600 "${SSH_ENV}"
+ . "${SSH_ENV}" > /dev/null
+ /usr/bin/ssh-add;
+}
+
+if [ -f "${SSH_ENV}" ]; then
+ . "${SSH_ENV}" > /dev/null
+ ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ > /dev/null || {
+ start_agent;
+ }
+else
+ start_agent;
+fi
+
+# #############################################################################
# functions
# #############################################################################
@@ -213,11 +237,11 @@ if [[ $(on_gcloud) == "yes" ]]; then
fi
# aws
-if [[ $(on_aws) == "yes" ]]; then
- HOSTCOLOR_BG=yellow
- HOSTCOLOR_FG=black
- alias tmux="tmux -f ~/.tmux.aws.conf"
-fi
+#if [[ $(on_aws) == "yes" ]]; then
+# HOSTCOLOR_BG=yellow
+# HOSTCOLOR_FG=black
+# alias tmux="tmux -f ~/.tmux.aws.conf"
+#fi
function chpwd
{