Only try to change shell on interactive sessions.

This commit is contained in:
David Tomaschik
2016-02-07 16:05:21 -08:00
parent 9a26c713d7
commit d35dd23019

View File

@@ -5,10 +5,12 @@ set errexit
function prerequisites { function prerequisites {
if which zsh > /dev/null ; then if which zsh > /dev/null ; then
if [[ $- == *i* ]] ; then
if [[ `getent passwd $USER | cut -d: -f7` != */zsh ]] ; then if [[ `getent passwd $USER | cut -d: -f7` != */zsh ]] ; then
echo 'Enter password to change shell.' >&2 echo 'Enter password to change shell.' >&2
chsh -s `which zsh` chsh -s `which zsh`
fi fi
fi
install_git https://github.com/robbyrussell/oh-my-zsh.git $HOME/.oh-my-zsh install_git https://github.com/robbyrussell/oh-my-zsh.git $HOME/.oh-my-zsh
else else
echo "ZSH not found!" >&2 echo "ZSH not found!" >&2