diff --git a/bash/bash_aliases.sh b/bash/bash_aliases.sh index f7214ed..d7d486d 100644 --- a/bash/bash_aliases.sh +++ b/bash/bash_aliases.sh @@ -2,6 +2,11 @@ # Find the path of the git repository relative to this file. export __COMMON_CONFIGS=$(readlink -e "$( dirname "$(realpath -e "${BASH_SOURCE[0]}")" )/..") +# Set the SSH auth sock to the central location +if [[ -n $SSH_AUTH_SOCK ]] && [[ $SSH_AUTH_SOCK != $HOME/.ssh/ssh_auth_sock ]]; then + ln -sf "$SSH_AUTH_SOCK" "$HOME/.ssh/ssh_auth_sock" +fi +export SSH_AUTH_SOCK="$HOME/.ssh/ssh_auth_sock" # Install EDITOR export EDITOR='nvim' diff --git a/per-host/costadelsol/.ssh/rc b/per-host/costadelsol/.ssh/rc index 24a0d91..6939f27 100644 --- a/per-host/costadelsol/.ssh/rc +++ b/per-host/costadelsol/.ssh/rc @@ -1,2 +1,6 @@ -#!/bin/bash -. ${BASH_SOURCE[0]}.rc-common +if [ -n "$BASH_VERSION" ]; then + export __COMMON_CONFIGS=$(readlink -e "$( dirname "$(realpath -e "${BASH_SOURCE[0]}")" )/../../..") + source ${__COMMON_CONFIGS}/ssh/rc +else + exec bash ~/.ssh/rc +fi diff --git a/per-host/crystarium/.ssh/rc b/per-host/crystarium/.ssh/rc index 24a0d91..6939f27 100644 --- a/per-host/crystarium/.ssh/rc +++ b/per-host/crystarium/.ssh/rc @@ -1,2 +1,6 @@ -#!/bin/bash -. ${BASH_SOURCE[0]}.rc-common +if [ -n "$BASH_VERSION" ]; then + export __COMMON_CONFIGS=$(readlink -e "$( dirname "$(realpath -e "${BASH_SOURCE[0]}")" )/../../..") + source ${__COMMON_CONFIGS}/ssh/rc +else + exec bash ~/.ssh/rc +fi diff --git a/per-host/goldsaucer/.ssh/rc b/per-host/goldsaucer/.ssh/rc index 24a0d91..6939f27 100644 --- a/per-host/goldsaucer/.ssh/rc +++ b/per-host/goldsaucer/.ssh/rc @@ -1,2 +1,6 @@ -#!/bin/bash -. ${BASH_SOURCE[0]}.rc-common +if [ -n "$BASH_VERSION" ]; then + export __COMMON_CONFIGS=$(readlink -e "$( dirname "$(realpath -e "${BASH_SOURCE[0]}")" )/../../..") + source ${__COMMON_CONFIGS}/ssh/rc +else + exec bash ~/.ssh/rc +fi diff --git a/per-host/gubal/.ssh/rc b/per-host/gubal/.ssh/rc index 24a0d91..6939f27 100644 --- a/per-host/gubal/.ssh/rc +++ b/per-host/gubal/.ssh/rc @@ -1,2 +1,6 @@ -#!/bin/bash -. ${BASH_SOURCE[0]}.rc-common +if [ -n "$BASH_VERSION" ]; then + export __COMMON_CONFIGS=$(readlink -e "$( dirname "$(realpath -e "${BASH_SOURCE[0]}")" )/../../..") + source ${__COMMON_CONFIGS}/ssh/rc +else + exec bash ~/.ssh/rc +fi diff --git a/per-host/mordhona/.ssh/rc b/per-host/mordhona/.ssh/rc index 24a0d91..6939f27 100644 --- a/per-host/mordhona/.ssh/rc +++ b/per-host/mordhona/.ssh/rc @@ -1,2 +1,6 @@ -#!/bin/bash -. ${BASH_SOURCE[0]}.rc-common +if [ -n "$BASH_VERSION" ]; then + export __COMMON_CONFIGS=$(readlink -e "$( dirname "$(realpath -e "${BASH_SOURCE[0]}")" )/../../..") + source ${__COMMON_CONFIGS}/ssh/rc +else + exec bash ~/.ssh/rc +fi diff --git a/per-host/template/.ssh/rc b/per-host/template/.ssh/rc index 24a0d91..6939f27 100644 --- a/per-host/template/.ssh/rc +++ b/per-host/template/.ssh/rc @@ -1,2 +1,6 @@ -#!/bin/bash -. ${BASH_SOURCE[0]}.rc-common +if [ -n "$BASH_VERSION" ]; then + export __COMMON_CONFIGS=$(readlink -e "$( dirname "$(realpath -e "${BASH_SOURCE[0]}")" )/../../..") + source ${__COMMON_CONFIGS}/ssh/rc +else + exec bash ~/.ssh/rc +fi diff --git a/zsh/customizations/zsh_aliases.zsh b/zsh/customizations/zsh_aliases.zsh index 10b0290..c51ab9c 100644 --- a/zsh/customizations/zsh_aliases.zsh +++ b/zsh/customizations/zsh_aliases.zsh @@ -4,6 +4,11 @@ export EDITOR='nvim' # Set up the vim config path export VIM_CONFIG_DIR=$__COMMON_CONFIGS/vim +# Set the SSH auth sock to the central location +if [[ -n $SSH_AUTH_SOCK ]] && [[ $SSH_AUTH_SOCK != $HOME/.ssh/ssh_auth_sock ]]; then + ln -sf "$SSH_AUTH_SOCK" "$HOME/.ssh/ssh_auth_sock" +fi +export SSH_AUTH_SOCK="$HOME/.ssh/ssh_auth_sock" # Set potentially-destructive commands to use interactive modes alias rm='rm -i'