Fix shell selection bug in Bionic version (#2573)

This commit is contained in:
Igor Pečovnik 2021-01-22 12:54:39 +01:00 committed by GitHub
parent 8a30fc1293
commit 315ca731f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 5 deletions

View File

@ -320,9 +320,6 @@ install_common()
fi
fi
# set default shell back to BASH and prompt for selection at first login
chroot "${SDCARD}" /bin/bash -c "chsh -s $(grep /bash$ /etc/shells | tail -1)"
# install kernel sources
if [[ -f ${DEB_STORAGE}/${CHOSEN_KSRC}_${REVISION}_all.deb && $INSTALL_KSRC == yes ]]; then
install_deb_chroot "${DEB_STORAGE}/${CHOSEN_KSRC}_${REVISION}_all.deb"

View File

@ -55,12 +55,14 @@ set_shell()
esac
done
fi
SHELL_PATH=$(grep /$USER_SHELL$ /etc/shells | tail -1)
chsh -s $(grep -iF "/$USER_SHELL" /etc/shells | tail -1)
echo -e "\nShell: \x1B[92m${USER_SHELL^^}\x1B[0m"
# change shell for future users
sed -i "s/^SHELL=.*/SHELL=\/usr\/bin\/${USER_SHELL}/" /etc/default/useradd
sed -i "s/^DSHELL=.*/DSHELL=\/usr\/bin\/${USER_SHELL}/" /etc/adduser.conf
sed -i "s|^SHELL=.*|SHELL=${SHELL_PATH}|" /etc/default/useradd
sed -i "s|^DSHELL=.*|DSHELL=${SHELL_PATH}|" /etc/adduser.conf
}