Skip keychain on non-interactive shells

This commit is contained in:
dctrud 2022-02-16 08:15:35 -06:00
parent bcb58519c2
commit 98121ad251
1 changed files with 6 additions and 2 deletions

View File

@ -1,3 +1,7 @@
if command -v keychain &> /dev/null; then
eval $(keychain --eval --agents ssh id_rsa)
if [ -z "$PS1" ]; then
echo "Skipping keychain"
else
if command -v keychain &> /dev/null; then
eval $(keychain --eval --agents ssh id_rsa)
fi
fi