]> arthur.barton.de Git - ConfigScripts.git/commitdiff
Make check for "interactive shells" more robust
authorAlexander Barton <alex@barton.de>
Sat, 29 Nov 2014 22:36:29 +0000 (23:36 +0100)
committerAlexander Barton <alex@barton.de>
Sat, 29 Nov 2014 22:37:01 +0000 (23:37 +0100)
sys/bashrc
sys/profile

index 559cc8c54b85f96ce1d3ad8f18cd012de2c85dc0..40087fe34706f1da620ee249067091579d0c3660 100644 (file)
@@ -13,7 +13,10 @@ BASHRCREAD="true"
 [ -e ~/.ConfigScripts.debug ] && echo " >> /etc/bash.bashrc ..."
 
 # Interactive shell?
-[ "$PS1" ] || return
+case "$-" in
+       *i*) ;;
+       *) return ;;
+esac
 
 # Initialize keychain(1) ssh-agent and gpg-agent helper
 type -t keychain >/dev/null \
index 0e69c899f74138f13e080bbd8b44eba7ac4ac64f..207bf5baf2134451e606fec6158fa0e02b60b2a8 100644 (file)
@@ -153,7 +153,10 @@ fi
 [ -r "/var/lib/${HOSTNAME}/profile" ] && . /var/lib/${HOSTNAME}/profile
 
 # interactive shell?
-[ "$PS1" ] || return
+case "$-" in
+       *i*) ;;
+       *) return ;;
+esac
 
 # validate terminal definition
 type -t tset >/dev/null && eval `tset -s -Q`