17 lines
421 B
Bash
Executable File
17 lines
421 B
Bash
Executable File
#!/bin/sh
|
|
|
|
scans=`arp-scan -l | grep -E '^(\d{1,3}\.){3}\d{1,3}'| sort -n -t . -k 1,1 -k 2,2 -k 3,3 -k 4,4`
|
|
|
|
|
|
while read -r line; do
|
|
items=($line)
|
|
ip=${items[0]}
|
|
mac=${items[1]}
|
|
vendor=${items[@]:2}
|
|
cmd="awk '\$1 == \"$mac\" { \$1=\"\"; print \$0 }' < ~/.config/mac-list"
|
|
name=$(eval $cmd)
|
|
echo "\\033[32m$ip}\\033[36m$mac}\\033[0m$name}[\\033[33m$vendor\\033[0m]"
|
|
done <<< "$scans" |
|
|
columnize -t -s '}'
|
|
|