include .bashrc in shell config

This commit is contained in:
2026-03-15 09:29:27 +01:00
parent d590838761
commit 6d5379278e
4 changed files with 170 additions and 62 deletions
+5
View File
@@ -6,6 +6,11 @@
GPG_SSH_SOCKET=$(gpgconf --list-dirs agent-ssh-socket)
if [ -z "$GPG_SSH_SOCKET" ]; then
echo "Error: gpgconf did not return a valid SSH socket path." >&2
exit 1
fi
if [ -z "$SSH_AUTH_SOCK" ] || [ "$SSH_AUTH_SOCK" != "$GPG_SSH_SOCKET" ]; then
echo "export SSH_AUTH_SOCK='$GPG_SSH_SOCKET';"
fi
+2 -1
View File
@@ -17,6 +17,7 @@ if [ -z "$SSH_AUTH_SOCK" ]; then
. "$agent_file" > /dev/null 2>&1
# check if the socket is actually working
if [ "$(ssh-add -l > /dev/null 2>&1; echo $?)" -eq 2 ]; then
# if not, unset it to create a new one
unset SSH_AUTH_SOCK
fi
fi
@@ -27,4 +28,4 @@ if [ -z "$SSH_AUTH_SOCK" ]; then
fi
[ -f "$agent_file" ] && cat "$agent_file"
fi
fi