File: dns_leases.sh

package info (click to toggle)
arpalert 2.0.12-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,584 kB
  • sloc: ansic: 4,456; sh: 517; makefile: 116; perl: 35
file content (14 lines) | stat: -rwxr-xr-x 455 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/bash

LEASES=/usr/local/arpalert/var/lib/arpalert/arpalert.leases
for i in `cat $LEASES | awk '{ print $2 }'`
do
        echo -en "$i\t\t"
        if [ `nslookup -sil $i | grep name | awk '{ print $4 }'` ]
        then
                echo -en "`nslookup -sil $i | grep name | awk '{ print $4 }'`\t\t"
        else
                echo -en "DNS Unassigned\t\t\t"
        fi
        echo -en "`cat $LEASES | grep -w $i | awk '{ print $1 }'`\n"
done