termux-tools: do not start login shell if not running on terminal

Fixes execution of commands via non-interactive shell with OpenSSH.
Issue https://github.com/termux/termux-packages/issues/3620.
This commit is contained in:
Leonid Pliushch 2019-04-04 12:49:32 +03:00
parent 9e5ab3997b
commit 5d29da3dc6
2 changed files with 6 additions and 2 deletions

View File

@ -1,7 +1,7 @@
TERMUX_PKG_HOMEPAGE=https://termux.com/
TERMUX_PKG_DESCRIPTION="Basic system tools for Termux"
TERMUX_PKG_LICENSE="GPL-3.0"
TERMUX_PKG_VERSION=0.61
TERMUX_PKG_VERSION=0.62
TERMUX_PKG_PLATFORM_INDEPENDENT=yes
TERMUX_PKG_ESSENTIAL=yes
TERMUX_PKG_DEPENDS="termux-am"

View File

@ -20,4 +20,8 @@ if [ -f $PREFIX/lib/libtermux-exec.so ]; then
$SHELL -c "busybox true" > /dev/null 2>&1 || unset LD_PRELOAD
fi
exec "$SHELL" -l "$@"
if [ -n "$TERM" ]; then
exec "$SHELL" -l "$@"
else
exec "$SHELL" "$@"
fi