Unverified Commit 476bfdaf authored by Igor Pečovnik's avatar Igor Pečovnik Committed by GitHub
Browse files

Zsh fix (#139)

* ZSH fix

* fixing menu too
parent 3bc9fd7f
...@@ -878,6 +878,12 @@ function jobs () ...@@ -878,6 +878,12 @@ function jobs ()
"BASH" ) "BASH" )
if ! is_package_manager_running; then if ! is_package_manager_running; then
debconf-apt-progress -- apt-get purge -y armbian-zsh debconf-apt-progress -- apt-get purge -y armbian-zsh
BASHLOCATION=$(grep /bash$ /etc/shells | tail -1)
# change shell back to bash for future users
sed -i "s|^SHELL=.*|SHELL=${BASHLOCATION}|" /etc/default/useradd
sed -i "s|^DSHELL=.*|DSHELL=${BASHLOCATION}|" /etc/adduser.conf
# change to BASH shell for root and all normal users
awk -F'[/:]' '{if ($3 >= 1000 && $3 != 65534 || $3 == 0) print $1}' /etc/passwd | xargs -L1 chsh -s $(grep /bash$ /etc/shells | tail -1)
if [[ -z $scripted ]]; then if [[ -z $scripted ]]; then
dialog --backtitle "$BACKTITLE" --title "Info" --colors --msgbox "\nYour default shell was switched to: \Z1BASH\Z0\n\nPlease logout & login from this session!" 9 47 dialog --backtitle "$BACKTITLE" --title "Info" --colors --msgbox "\nYour default shell was switched to: \Z1BASH\Z0\n\nPlease logout & login from this session!" 9 47
fi fi
......
...@@ -84,7 +84,7 @@ while true; do ...@@ -84,7 +84,7 @@ while true; do
LIST+=( "SSH" "Reconfigure SSH daemon" ) LIST+=( "SSH" "Reconfigure SSH daemon" )
LIST+=( "Firmware" "Run apt update & apt upgrade" ) LIST+=( "Firmware" "Run apt update & apt upgrade" )
if [[ "$SHELL" != "/bin/bash" ]]; then if [[ "$SHELL" != *bash ]]; then
LIST+=( "BASH" "Revert to stock BASH shell" ) LIST+=( "BASH" "Revert to stock BASH shell" )
else else
LIST+=( "ZSH" "Install ZSH with plugins and tmux" ) LIST+=( "ZSH" "Install ZSH with plugins and tmux" )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment