From 476bfdaf07bb7d4b90b6b7f2eb8f8829c88b05cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Igor=20Pe=C4=8Dovnik?= Date: Sat, 6 Mar 2021 21:10:15 +0100 Subject: [PATCH] Zsh fix (#139) * ZSH fix * fixing menu too --- debian-config-jobs | 6 ++++++ debian-config-submenu | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/debian-config-jobs b/debian-config-jobs index 0e85ef1..200820f 100644 --- a/debian-config-jobs +++ b/debian-config-jobs @@ -878,6 +878,12 @@ function jobs () "BASH" ) if ! is_package_manager_running; then 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 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 diff --git a/debian-config-submenu b/debian-config-submenu index 7bdf75c..1b47fe2 100644 --- a/debian-config-submenu +++ b/debian-config-submenu @@ -84,7 +84,7 @@ while true; do LIST+=( "SSH" "Reconfigure SSH daemon" ) LIST+=( "Firmware" "Run apt update & apt upgrade" ) - if [[ "$SHELL" != "/bin/bash" ]]; then + if [[ "$SHELL" != *bash ]]; then LIST+=( "BASH" "Revert to stock BASH shell" ) else LIST+=( "ZSH" "Install ZSH with plugins and tmux" )