snippets for bash_profile, mainly for servers with ssh access
Last active
August 29, 2015 14:22
-
-
Save kudrevatykh/a7518be9c249415667bf to your computer and use it in GitHub Desktop.
bash profile snippet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##GPG AGENT## | |
if [ -f "$HOME"/.gpg-agent-info ]; then | |
eval $(cat "$HOME"/.gpg-agent-info) | |
eval $(cut -d= -f 1 < "$HOME"/.gpg-agent-info | xargs echo export) | |
fi | |
gpg-connect-agent /bye 2> /dev/null | |
if [ $? != 0 ] ; then | |
eval $(gpg-agent --daemon --write-env-file) | |
fi | |
GPG_TTY=$(tty) | |
export GPG_TTY | |
##SSH AGENT AND SCREEN/TMUX## | |
if [ -n "$SSH_TTY" -a -S "$SSH_AUTH_SOCK" ]; then | |
ln -sf "$SSH_AUTH_SOCK" "$HOME/.ssh/ssh-auth-sock" | |
SSH_AUTH_SOCK="$HOME/.ssh/ssh-auth-sock" | |
export SSH_AUTH_SOCK | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment