Files
termux-docker-pacman/system/arm/bin/update-static-dns
Leonid Pliushch d616bfb0b6 initial support for arm/arm64 containers
Issue https://github.com/termux/termux-docker/issues/9.

System components are imported from Android 9 GSI (aarch64).
2021-02-16 01:04:18 +02:00

18 lines
472 B
Bash
Executable File

#!/system/bin/sh
export PATH=/system/bin
echo "127.0.0.1 localhost" > /system/etc/hosts
echo "::1 ip6-localhost" >> /system/etc/hosts
for host in $(busybox cat /system/etc/static-dns-hosts.txt | busybox grep -vE '^\s*#'); do
ip_addr=$(busybox nslookup -type=a "$host" 8.8.8.8 | busybox awk '/^Address: / { print $2 ; exit }')
if [ -z "$ip_addr" ]; then
echo "Can't resolve '$host'." >&2
exit 1
fi
echo "$ip_addr $host" | busybox tee -a /system/etc/hosts
done