Changed shells were not being recognized

The check for a changed shell (e.g. by chsh) was correctly using $HOME/.termux/shell, but $HOME was being hardcoded to "/home" prior to the check.

Since most likely, $HOME is not yet "/home" (since the user is invoking termux-chroot) this test was failing to recognize changed shells (e.g. this failed with zsh).

Moving the assignment of HOME to /home after the shell has been read fixes this.
This commit is contained in:
Vijay Vaidyanathan 2018-06-23 23:38:02 -07:00 committed by Fredrik Fornwall
parent 471a7fdd40
commit 4265175009

View File

@ -69,13 +69,14 @@ ARGS="$ARGS --cwd=/home"
# Root of the file system:
ARGS="$ARGS -r $PREFIX/.."
export HOME=/home
# Shell to execute:
PROGRAM=/bin/bash
if [ -x $HOME/.termux/shell ]; then
PROGRAM=`readlink -f $HOME/.termux/shell`
fi
export HOME=/home
# Execute shell if no command has been supplied
if [ -z "$1" ];then
ARGS="$ARGS $PROGRAM -l"