blob: e7c9dfc91671d7e909736f18fbc7b88aa2d0b1df (
plain) (
tree)
|
|
#!/bin/ash
net_resolve_v4() {
if command -v dig &> /dev/null; then
printf "%s " $( busybox timeout -t 2 dig +short "$1" | grep -E '^[0-9.]+$' )
elif command -v nslookup &> /dev/null; then
printf "%s " $( LC_ALL=C busybox timeout -t 2 nslookup "$1" 2>/dev/null | grep -A 4 '^Name:' | grep -E '^Address\s*[0-9]*: ' | awk -F': ' '{print $2}' | grep -oE '^[0-9]+\.[0-9.]+(\s|$)' )
fi
}
|