#!/bin/sh
# Ping Observation Tool
# POT Logfile Analyzer
if test -z $1
 then echo usage: $0 \<logfile\>
fi
if ! test -e $1 
 then echo usage: $0 \<logfile\>
fi
echo -n Sorting $1
awk -F. '{print $1"."$2"."$3}' $1 | sort | uniq --count > $1.unf
echo -n .
awk -F. '{print $1"."$2"."$3".0"}' $1.unf > $1.unfunf
echo -n .
awk -F. '{print $1"."$2"."$3".255"}' $1.unf >> $1.unfunf
echo -n .
sort -u $1.unfunf >> $1.done
echo -n .
awk '{print $2}' $1.done > $1.list
echo .done
rm -f $1.unf $1.unfunf
echo Results in $1.done \(detailed\) / $1.list \(ip list\)
echo `wc -l $1.list|awk '{print $1}'` broadcasts found total
