termux-tools: Make bin/login handle arguments
authorFredrik Fornwall <fredrik@fornwall.net>
Sun, 17 Sep 2017 20:43:03 +0000 (22:43 +0200)
committerFredrik Fornwall <fredrik@fornwall.net>
Sun, 17 Sep 2017 20:43:03 +0000 (22:43 +0200)
As we now use bin/login even from e.g. sshd we need to handle
arguments by forwarding it to the login shell and not displaying
a motd in that case. Fixes #1529.

packages/termux-tools/build.sh
packages/termux-tools/login

index 8a06715..332051b 100644 (file)
@@ -1,6 +1,6 @@
 TERMUX_PKG_HOMEPAGE=https://termux.com/
 TERMUX_PKG_DESCRIPTION="Basic system tools for Termux"
-TERMUX_PKG_VERSION=0.45
+TERMUX_PKG_VERSION=0.46
 TERMUX_PKG_PLATFORM_INDEPENDENT=yes
 TERMUX_PKG_CONFFILES="etc/motd"
 
index f01e293..9da9aac 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
 
@@ -19,5 +19,4 @@ if [ -f $PREFIX/lib/libtermux-exec.so ]; then
        export LD_PRELOAD=$PREFIX/lib/libtermux-exec.so
 fi
 
-exec "$SHELL" -l
-
+exec "$SHELL" -l "$@"