mirror of
https://github.com/zerotier/edge.git
synced 2026-05-22 16:25:05 -07:00
23 lines
639 B
Bash
Executable File
23 lines
639 B
Bash
Executable File
#!/bin/sh
|
|
# @(#) $Id: arp2ethers,v 1.4 2002/01/05 19:40:47 leres Exp $ (LBL)
|
|
#
|
|
# Convert arp.dat to ethers format
|
|
#
|
|
# - sort on timestamp, newest first
|
|
# - discard entries without simple hostnames
|
|
# - discard all but first occurance of each ethernet address
|
|
# - discard entires with raw ip addresses for simple names
|
|
# - remove ip address and timestamp fields
|
|
# - append "-ip" to hosts with decnet address too
|
|
# - append "-old", "-old1", etc. as necessary
|
|
# - sort
|
|
#
|
|
|
|
export AWKPATH="$AWKPATH:/usr/share/arpwatch/awk"
|
|
|
|
sort -k 3rn ${1:-/var/lib/arpwatch/arp.dat} | \
|
|
awk -f p.awk | \
|
|
awk -f d.awk | \
|
|
awk -f e.awk | \
|
|
sort
|