Last active
July 23, 2019 11:33
-
-
Save Hologos/c2c78e72b6ada5e4b9b471dd9a0d7e22 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env bash | |
for if_name in $(ifconfig -l); do | |
if ! [[ "${if_name}" =~ ^en[0-9]+$ ]]; then | |
break | |
fi | |
for if_ip in $(ifconfig "${if_name}" | grep 'inet' | awk '{ print $2 }'); do | |
nslookup "${if_ip}" | grep 'name = ' | awk '{ print $4 }' | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment