Skip to content

Commit

Permalink
Don't resolve hostnames to dump arp, resolve when resolving guest IP
Browse files Browse the repository at this point in the history
  • Loading branch information
jackyaz committed Oct 28, 2020
1 parent 81dfdd8 commit d1f99fc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions YazFi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2175,7 +2175,7 @@ Menu_Status(){
ScriptHeader
printf "\\e[1m$PASS%sQuerying router for connected WiFi clients...\\e[0m\\n\\n" ""

ARPDUMP="$(arp -a)"
ARPDUMP="$(arp -an)"

for IFACE in $IFACELIST; do
if [ "$(eval echo '$'"$(Get_Iface_Var "$IFACE")""_ENABLED")" = "true" ]; then
Expand All @@ -2191,7 +2191,7 @@ Menu_Status(){
GUEST_MACADDR="${GUEST_MAC#* }"
GUEST_ARPINFO="$(echo "$ARPDUMP" | grep "$IFACE" | grep -i "$GUEST_MACADDR")"
GUEST_IPADDR="$(echo "$GUEST_ARPINFO" | awk '{print $2}' | sed -e 's/(//g;s/)//g')"
GUEST_HOST="$(echo "$GUEST_ARPINFO" | awk '{print $1}' | cut -f1 -d ".")"
GUEST_HOST="$(arp "$GUEST_IPADDR" | awk '{print $1}' | cut -f1 -d ".")"
if [ "$GUEST_HOST" = "?" ]; then
GUEST_HOST=$(grep -i "$GUEST_MACADDR" /var/lib/misc/dnsmasq.leases | awk '{print $4}')
fi
Expand Down

0 comments on commit d1f99fc

Please sign in to comment.