mirror of
https://gitea.blesmrt.net/mikaela/shell-things.git
synced 2024-11-25 12:49:26 +01:00
parent
64d5fef6f3
commit
1e707dd586
16
rc/bashrc
16
rc/bashrc
@ -214,9 +214,21 @@ if [[ $USER = "root" ]]; then
|
||||
echo 'APT::Color "1";' > /etc/apt/apt.conf.d/99color
|
||||
fi
|
||||
|
||||
# Copied from https://homepages.see.leeds.ac.uk/~eeaol/notes/2012/03/how_to_only_type_ssh_passphrase_once/
|
||||
# if gpg[-agent] has sshcontrol file, use it as ssh-agent. sshcontrol should
|
||||
# include the authentication subkey keygrip from
|
||||
# `gpg --with-keygrip --list-keys`
|
||||
# Assumption: there is not going to be a sshcontrol file if `gpgconf` is not
|
||||
# installed or `sshcontrol` is trivial to remove.
|
||||
if [ -f ~/.gnupg/sshcontrol ]; then
|
||||
export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket)
|
||||
gpgconf --launch gpg-agent
|
||||
gpg-connect-agent updatestartuptty /bye >/dev/null 2>&1
|
||||
# otherwise use the normal ssh-agent
|
||||
else
|
||||
# if the output is going to /dev/null, it's non/existence doesn't matter
|
||||
(ssh-agent -a /tmp/$USER.agent > /dev/null 2>&1)
|
||||
export SSH_AUTH_SOCK=/tmp/$USER.agent
|
||||
(ssh-agent -a /tmp/$USER.agent > /dev/null 2>&1&)
|
||||
fi
|
||||
|
||||
# OS X ls colours (copied from https://apple.stackexchange.com/questions/33677/
|
||||
export CLICOLOR=1
|
||||
|
16
rc/zshrc
16
rc/zshrc
@ -165,9 +165,21 @@ export LESS_TERMCAP_us=$'\E[01;32m'
|
||||
# Sets environment variable CPUARCH to output of "uname -p" & UNAME to "uname"
|
||||
CPUARCH=$(uname -p)
|
||||
|
||||
# Copied from https://homepages.see.leeds.ac.uk/~eeaol/notes/2012/03/how_to_only_type_ssh_passphrase_once/
|
||||
# if gpg[-agent] has sshcontrol file, use it as ssh-agent. sshcontrol should
|
||||
# include the authentication subkey keygrip from
|
||||
# `gpg --with-keygrip --list-keys`
|
||||
# Assumption: there is not going to be a sshcontrol file if `gpgconf` is not
|
||||
# installed or `sshcontrol` is trivial to remove.
|
||||
if [ -f ~/.gnupg/sshcontrol ]; then
|
||||
export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket)
|
||||
gpgconf --launch gpg-agent
|
||||
gpg-connect-agent updatestartuptty /bye >/dev/null 2>&1
|
||||
# otherwise use the normal ssh-agent
|
||||
else
|
||||
# if the output is going to /dev/null, it's non/existence doesn't matter
|
||||
(ssh-agent -a /tmp/$USER.agent > /dev/null 2>&1)
|
||||
export SSH_AUTH_SOCK=/tmp/$USER.agent
|
||||
ssh-agent -a /tmp/$USER.agent > /dev/null 2>&1
|
||||
fi
|
||||
|
||||
# If we are on Linux, enable apt progress bar and colours
|
||||
if [[ $USER = "root" ]]; then
|
||||
|
Loading…
Reference in New Issue
Block a user