#!/bin/bash

# find obsoleted solaris patches

for i in /var/lib/nessus/plugins/solaris9*; do # probably works for other Solaris releases, too 
	p=`grep 'patch:"[0-9-]*", obsoleted_by:"",' $i | awk -F '"' '{print $6}'`
	if [ "$p" ]; then 
		sleep 10 ; # no, don't DoS sun servers :-)
		o=`wget -q -O - 'http://sunsolve.sun.com/search/document.do?assetkey=1-21-'$p | grep "title.*Obsoleted by:" | awk '{print $4}'` 
		if [ "$o" ] ; then 
			echo "$p -> $o" 
		fi
	fi
done

