Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@ SHELL ["sh", "-c"]
# so this odd-looking script forces the update process
# to work using the -s argument of toybox-su instead, which is working.
RUN sh -T /dev/ptmx -c "$TERMUX__PREFIX/bin/dnsmasq -u root -g root --pid-file=/dnsmasq.pid" && \
sleep 1 && \
echo '#!/system/bin/sh' > /update.sh && \
echo "PATH=$TERMUX__PREFIX/bin" >> /update.sh && \
echo 'while [ ! -f /dnsmasq.pid ]; do' >> /update.sh && \
echo 'sleep 1' >> /update.sh && \
echo 'done' >> /update.sh && \
echo "source $TERMUX__PREFIX/bin/termux-setup-package-manager" >> /update.sh && \
echo 'if [ "$TERMUX_APP_PACKAGE_MANAGER" = "apt" ]; then' >> /update.sh && \
echo 'apt update' >> /update.sh && \
Expand Down
9 changes: 5 additions & 4 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@ if [ "$(id -u)" != "0" ]; then
fi

if [ -z "$(pidof dnsmasq)" ]; then
rm -f /dnsmasq.pid
/system/bin/sh -T /dev/ptmx -c "dnsmasq -u root -g root --pid-file=/dnsmasq.pid" >/dev/null 2>&1
sleep 1
if [ -z "$(pidof dnsmasq)" ]; then
echo "[!] Failed to start dnsmasq, host name resolution may fail." >&2
fi
fi

while [ ! -f /dnsmasq.pid ]; do
sleep 1
done

exec /system/bin/su -s "$PREFIX/bin/env" system -- \
-i \
ANDROID_DATA="$ANDROID_DATA" \
Expand Down
9 changes: 5 additions & 4 deletions entrypoint_root.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ if [ "$(id -u)" != "0" ]; then
fi

if [ -z "$(pidof dnsmasq)" ]; then
rm -f /dnsmasq.pid
/system/bin/sh -T /dev/ptmx -c "dnsmasq -u root -g root --pid-file=/dnsmasq.pid" >/dev/null 2>&1
sleep 1
if [ -z "$(pidof dnsmasq)" ]; then
echo "[!] Failed to start dnsmasq, host name resolution may fail." >&2
fi
fi

while [ ! -f /dnsmasq.pid ]; do
sleep 1
done

exec "$@"
Loading