cb89fcd8d6b940d2d490c7791b2b5859672a5dc5

Author
Robby Russell <robby@planetargon.com>
Committer
Robby Russell <robby@planetargon.com>
Date

Message

Merge pull request #2836 from ptamarit/chsh-etc-shells

Install script's chsh not working on Fedora

Diff

 1diff --git a/tools/install.sh b/tools/install.sh
 2index bd4c5574988646ed5ebb55704e5046665b9c16bd..c83a6f23d0776abec9a189f90d0846d8d3036ab0 100755
 3--- a/tools/install.sh
 4+++ b/tools/install.sh
 5@@ -32,10 +32,12 @@ sed -i -e "/export PATH=/ c\\
 6 export PATH=\"$PATH\"
 7 " ~/.zshrc
 8 
 9-if [ "$SHELL" != "$(which zsh)" ]; then
10+TEST_CURRENT_SHELL=$(expr "$SHELL" : '.*/\(.*\)')
11+if [ "$TEST_CURRENT_SHELL" != "zsh" ]; then
12     echo "\033[0;34mTime to change your default shell to zsh!\033[0m"
13-    chsh -s `which zsh`
14+    chsh -s $(grep /zsh$ /etc/shells | tail -1)
15 fi
16+unset TEST_CURRENT_SHELL
17 
18 echo "\033[0;32m"'         __                                     __   '"\033[0m"
19 echo "\033[0;32m"'  ____  / /_     ____ ___  __  __   ____  _____/ /_  '"\033[0m"