#!/bin/sh # [4.2.3] cronjob - pingscan and reverse DNS based [nmap] # This example uses nmap to ping your whole network and take # a "snapshot" of it. nmap prints the DNS name acquired from # reverse DNS, if found. Else, nmap just prints the IP. This # is fine. NET="172.16.1.0/24" PREHOSTS="$HOME/.tcsh/hosts-pre" HOSTS="$HOME/.tcsh/hosts" (cat $PREHOSTS nmap -sP $NET | grep -v -i nmap | awk '{print $2}' ) | sort > $HOSTS