From: Alex Stade (alex@trdlnk.com)
Date: Wed Oct 16 2002 - 17:40:07 EDT
Brett Monroe replied to me saying that he had seen the same thing. So
this prompted me to write a quick script which wraps pprosvc, rather
than running it directly. This script can be run from cron. It's a bit
kludgy, but I am checking to see if I am in single user mode and then I
manually apply the patches. Again, very ugly, but it gets the job done.
Here's the script.
#!/bin/sh
touch /tmp/$$.tmp
touch /tmp/$$.out
stdPatch()
{
/opt/SUNWppro/bin/pprosvc -i > /tmp/$$.tmp 2>&1
}
advPatch()
{
/opt/SUNWppro/bin/pprosvc -i > /tmp/$$.tmp 2>&1
ni=`grep 'Not an installable patch type' /tmp/$$.tmp | sed
's/.*\([0-9]\{6\}-[0-9]\{2\}\)/\1/'`
rn=`grep 'Patch requirement for this patch is not met'
/tmp/$$.tmp | sed 's/.*\([0-9]\{6\}-[0-9]\{2\}\)/\1/'`
for pn in $ni ; do
(cd /tmp && jar xf
/var/spool/pkg/patchproSequester/$pn.jar && patchadd $pn && rm -rf $pn)
>> /tmp/$$.out 2>&1
done
for pr in $rn ; do
(cd /tmp && jar xf
/var/spool/pkg/patchproSequester/$pr.jar && patchadd $pr && rm -rf $pr)
>> /tmp/$$.out 2>&1
done
}
case `who -r | awk '{ print $3 }'` in
3|2)
stdPatch
;;
1)
advPatch
;;
S)
route add default `cat /etc/defaultrouter` 1
advPatch
;;
*)
echo "Not a compatible runlevel: `who -r | awk '{ print
$3 }'`"
exit 1
;;
esac
cp $$.tmp /var/tmp/ppro_run.`date +%Y%m%s`
cat $$.out >> /var/tmp/ppro_run.`date +%Y%m%s`
#rm /tmp/$$.*
-- --- ----- Alexander Stade 200 W. Jackson Blvd Suite 2300 Systems Administrator Chicago, IL 60606 TradeLink L.L.C. Phone - 312.264.2000 ext. 2027 alex@trdlnk.com Fax - 312.264.2001 _______________________________________________ sunmanagers mailing list sunmanagers@sunmanagers.org http://www.sunmanagers.org/mailman/listinfo/sunmanagers
This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 23:25:07 EDT