diff --git a/bash/bash_profile b/bash/bash_profile new file mode 100755 index 0000000..f8f4688 --- /dev/null +++ b/bash/bash_profile @@ -0,0 +1,35 @@ +# generated by Git for Windows +test -f ~/.profile && . ~/.profile +test -f ~/.bashrc && . ~/.bashrc +PS1='\w $ ' +export LANG=zh_CN.UTF-8 + +export _JAVA_OPTIONS="-Dfile.encoding=UTF-8" +export JAVA_OPTS="-Dfile.encoding=UTF-8" +export JAVA_TOOLS_OPTIONS="-Dfile.encoding=UTF-8" +export MAVEN_OPTS="-Dfile.encoding=UTF-8" + +export VAGRANT_PREFER_SYSTEM_BIN=1 + +env=/tmp/agent.env + +agent_load_env () { test -f "$env" && . "$env" >| /dev/null ; } + +agent_start () { + (umask 077; ssh-agent >| "$env") + . "$env" >| /dev/null ; } + +agent_load_env + +# agent_run_state: 0=agent running w/ key; 1=agent w/o key; 2= agent not running +agent_run_state=$(ssh-add -l >| /dev/null 2>&1; echo $?) + +if [ ! "$SSH_AUTH_SOCK" ] || [ $agent_run_state = 2 ]; then + agent_start + ssh-add +elif [ "$SSH_AUTH_SOCK" ] && [ $agent_run_state = 1 ]; then + ssh-add +fi + +unset env +