2019-09-19 22:41:31 +02:00
|
|
|
#!/bin/sh
|
2017-02-12 21:01:01 +01:00
|
|
|
|
2019-09-19 22:57:17 +02:00
|
|
|
if [ $# = 0 ] && [ -f @TERMUX_PREFIX@/etc/motd ] && [ ! -f ~/.hushlogin ] && [ -z "$TERMUX_HUSHLOGIN" ]; then
|
|
|
|
cat @TERMUX_PREFIX@/etc/motd
|
2019-09-06 00:43:47 +02:00
|
|
|
else
|
|
|
|
# This variable shouldn't be kept set.
|
|
|
|
unset TERMUX_HUSHLOGIN
|
2017-02-12 21:01:01 +01:00
|
|
|
fi
|
|
|
|
|
2021-09-09 01:25:48 +02:00
|
|
|
# TERMUX_VERSION env variable has been exported since v0.107 and PATH was being set to following value in <0.104. Last playstore version was v0.101.
|
|
|
|
if [ $# = 0 ] && [ -f @TERMUX_PREFIX@/etc/motd-playstore ] && [ -z "$TERMUX_VERSION" ] && [ "$PATH" = "@TERMUX_PREFIX@/bin:@TERMUX_PREFIX@/bin/applets" ]; then
|
|
|
|
printf '\033[0;31m'; cat @TERMUX_PREFIX@/etc/motd-playstore; printf '\033[0m'
|
|
|
|
fi
|
|
|
|
|
2017-02-12 21:01:01 +01:00
|
|
|
if [ -G ~/.termux/shell ]; then
|
2018-07-14 00:02:50 +02:00
|
|
|
export SHELL="`realpath ~/.termux/shell`"
|
2017-02-12 21:01:01 +01:00
|
|
|
else
|
2019-09-19 22:57:17 +02:00
|
|
|
for file in @TERMUX_PREFIX@/bin/bash @TERMUX_PREFIX@/bin/sh /system/bin/sh; do
|
2017-02-12 21:01:01 +01:00
|
|
|
if [ -x $file ]; then
|
2018-07-14 00:02:50 +02:00
|
|
|
export SHELL=$file
|
2017-02-12 21:01:01 +01:00
|
|
|
break
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
|
2022-02-01 14:35:47 +01:00
|
|
|
# for the correct operation of scripts that work with the package manager
|
|
|
|
export TERMUX_MAIN_PACKAGE_FORMAT="@TERMUX_PACKAGE_FORMAT@"
|
|
|
|
|
2019-09-19 22:57:17 +02:00
|
|
|
if [ -f @TERMUX_PREFIX@/lib/libtermux-exec.so ]; then
|
|
|
|
export LD_PRELOAD=@TERMUX_PREFIX@/lib/libtermux-exec.so
|
2020-03-30 14:15:59 +02:00
|
|
|
$SHELL -c "coreutils --coreutils-prog=true" > /dev/null 2>&1 || unset LD_PRELOAD
|
2017-09-17 16:12:20 +02:00
|
|
|
fi
|
|
|
|
|
2021-10-13 13:09:24 +02:00
|
|
|
if [ -f @TERMUX_PREFIX@/etc/termux-login.sh ]; then
|
|
|
|
. @TERMUX_PREFIX@/etc/termux-login.sh
|
|
|
|
fi
|
|
|
|
|
2019-04-04 11:49:32 +02:00
|
|
|
if [ -n "$TERM" ]; then
|
|
|
|
exec "$SHELL" -l "$@"
|
|
|
|
else
|
|
|
|
exec "$SHELL" "$@"
|
|
|
|
fi
|