Browse Source

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.
android-5
Vijay Vaidyanathan 7 years ago
committed by Fredrik Fornwall
parent
commit
5eb885b930
  1. 5
      packages/proot/termux-chroot

5
packages/proot/termux-chroot

@ -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"

Loading…
Cancel
Save