Created
September 4, 2019 23:32
-
-
Save chrispetrou/3d16c19b015403fc9d16afdaa3dd1e3e 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
#!/bin/bash | |
if [ $# -lt 1 ]; then | |
echo "getmac.sh <IP>" | |
fi | |
IP=$1 | |
ping_output=$(ping -c1 $IP) | |
mac=ping_output; arp -a | grep $IP | cut -d ' ' -f4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment