docker: update argument handling in entrypoint script

This commit is contained in:
Leonid Pliushch
2023-02-23 11:46:42 +02:00
parent 988ecdaf07
commit 66799e6bc0

View File

@@ -11,14 +11,23 @@ if [ "$(id -u)" = "0" ]; then
else else
echo "[!] Container is running as non-root, unable to start dnsmasq. DNS will be unavailable." >&2 echo "[!] Container is running as non-root, unable to start dnsmasq. DNS will be unavailable." >&2
if [ $# -ge 1 ]; then if [ $# -ge 1 ]; then
exec /data/data/com.termux/files/usr/bin/bash -c "$@" exec "$@"
else else
exec /data/data/com.termux/files/usr/bin/login exec /data/data/com.termux/files/usr/bin/login
fi fi
fi fi
if [ $# -ge 1 ]; then if [ $# -ge 1 ]; then
exec /system/bin/su - system -c "/data/data/com.termux/files/usr/bin/bash -c \"$@\"" exec /system/bin/su - -s /data/data/com.termux/files/usr/bin/env system -- \
ANDROID_DATA="$ANDROID_DATA" \
ANDROID_ROOT="$ANDROID_ROOT" \
HOME="$HOME" \
LANG="$LANG" \
PATH="$PATH" \
PREFIX="$PREFIX" \
TMPDIR="$TMPDIR" \
TZ=UTC \
"$@"
else else
exec /data/data/com.termux/files/usr/bin/login exec /data/data/com.termux/files/usr/bin/login
fi fi