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
|
|
|
|
|
|
|
|
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
|
|
|
|
|
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
|
2018-02-21 00:08:15 +01:00
|
|
|
$SHELL -c "busybox true" > /dev/null 2>&1 || unset LD_PRELOAD
|
2017-09-17 16:12:20 +02:00
|
|
|
fi
|
|
|
|
|
2019-04-04 11:49:32 +02:00
|
|
|
if [ -n "$TERM" ]; then
|
|
|
|
exec "$SHELL" -l "$@"
|
|
|
|
else
|
|
|
|
exec "$SHELL" "$@"
|
|
|
|
fi
|