From d35dd230198277f93f561b249263b14b347f9e1a Mon Sep 17 00:00:00 2001 From: David Tomaschik Date: Sun, 7 Feb 2016 16:05:21 -0800 Subject: [PATCH] Only try to change shell on interactive sessions. --- install.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/install.sh b/install.sh index 7352879..82005bb 100755 --- a/install.sh +++ b/install.sh @@ -5,9 +5,11 @@ set errexit function prerequisites { if which zsh > /dev/null ; then - if [[ `getent passwd $USER | cut -d: -f7` != */zsh ]] ; then - echo 'Enter password to change shell.' >&2 - chsh -s `which zsh` + if [[ $- == *i* ]] ; then + if [[ `getent passwd $USER | cut -d: -f7` != */zsh ]] ; then + echo 'Enter password to change shell.' >&2 + chsh -s `which zsh` + fi fi install_git https://github.com/robbyrussell/oh-my-zsh.git $HOME/.oh-my-zsh else