preload-hacks: Some patches to make it work.
[termux-packages] / packages / termux-tools / login
index bbdb901..6e64b51 100755 (executable)
@@ -1,6 +1,6 @@
 #!/data/data/com.termux/files/usr/bin/sh
 
-if [ -f $PREFIX/etc/motd ] && [ ! -f ~/.hushlogin ]; then
+if [ $# = 0 ] && [ -f $PREFIX/etc/motd ] && [ ! -f ~/.hushlogin ]; then
        cat $PREFIX/etc/motd
 fi
 
@@ -15,5 +15,9 @@ else
        done
 fi
 
-exec "$SHELL" -l
+if [ -f $PREFIX/lib/libtermux-exec.so ]; then
+       export LD_PRELOAD=$PREFIX/lib/libtermux-exec.so
+       $SHELL -c "busybox true" > /dev/null 2>&1 || unset LD_PRELOAD
+fi
 
+exec "$SHELL" -l "$@"