.shenv-aether: Track .shenv customizations for 'aether'
[dotfiles.git] / .bash_profile
index 0b6071af2484c55173a9f5db776e69a603f6b8b9..be7ef93e81c4c2eb05c5fac93c9580eb1351b95c 100644 (file)
@@ -11,14 +11,16 @@ if [ "$UNAME" = "Cygwin" ]; then
 fi
 
 # keychain
-keychain="$(type -P keychain)"
-test -n "$keychain" && {
-  if [ -f ~/.ssh/id_rsa ]; then
-    eval `$keychain -q ~/.ssh/id_rsa`
+keychain=$(type -P keychain)
+test -n "$keychain" && \
+  test -z "$SUDO_USER" && {
+  ids=""
+  test -f ~/.ssh/id_rsa && ids="$ids id_rsa"
+  test -f ~/.ssh/id_ed25519 && ids="$ids id_ed25519"
+  if [ -n "$ids" ]; then
+    eval `$keychain -q $ids`
     source ~/.keychain/`hostname`-sh > /dev/null
   fi
+  unset ids
 }
 unset keychain
-
-# Load RVM function
-[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"