File: dns_leases.sh

package info (click to toggle)
arpalert 2.0.3-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 2,332 kB
  • ctags: 415
  • sloc: ansic: 4,185; sh: 447; makefile: 153; perl: 28
file content (14 lines) | stat: -rwxr-xr-x 455 bytes parent folder | download | duplicates (8)
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