Attempt to change default shell to zsh

This commit is contained in:
2021-04-21 16:18:32 +08:00
parent 1f0d0fb9d0
commit b783753895

View File

@@ -21,6 +21,19 @@ fi
git clone https://github.com/zsh-users/zsh-syntax-highlighting git clone https://github.com/zsh-users/zsh-syntax-highlighting
) )
echo "Changing default shell"
ZSH_PATH="$(which zsh)"
if sudo -l chsh -s $ZSH_PATH $USER; then
sudo chsh -s $ZSH_PATH $USER
elif sudo -l usermod -s $ZSH_PATH $USER; then
sudo usermod -s $ZSH_PATH $USER
else
echo "Cannot change shell using sudo, trying password"
if ! chsh -s "$ZSH_PATH"; then
echo "Unable to change shell to $ZSH_PATH, please change shell manually"
fi
fi
SKEL_DIR="$APP_DIR/skel" SKEL_DIR="$APP_DIR/skel"
BACK_DIR="$APP_DIR/backup" BACK_DIR="$APP_DIR/backup"