From db3faa31b0ed5148833618450a4ea6118bb5a32c Mon Sep 17 00:00:00 2001 From: Sandeep Murthy Date: Tue, 30 Dec 2014 11:53:29 +0000 Subject: [PATCH] Smoother way of changing default login shell back to bash --- tools/uninstall.sh | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/tools/uninstall.sh b/tools/uninstall.sh index 41d601576..96fb18799 100644 --- a/tools/uninstall.sh +++ b/tools/uninstall.sh @@ -20,9 +20,24 @@ then source ~/.zshrc; else - echo "Switching back to bash" + echo "Changing default login shell from zsh back to bash ... login required." chsh -s /bin/bash - source /etc/profile + if [ "$?" = "0" ]; then + echo "Done. All new shell windows will be bash!" + printf "Replace this zsh window with a bash window right now? (yes/no): " + read CHOICE + if [ "$CHOICE" = "yes" ]; then + echo "OK, please login again below ... if something goes wrong you can \ +always close this window and start a new bash window." + exec su - $USER + else + break + fi + else + echo "Oops, something went wrong with the change to bash ... \ +you can execute chsh -s /bin/bash manually and start a new window" + break + fi fi -echo "Thanks for trying out Oh My Zsh. It's been uninstalled." +echo -e "\nThanks for trying out Oh My Zsh. It's been uninstalled."