#!/bin/sh

# Copyright 2002 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.
#
#ident  "@(#)postpatch 1.1     03/06/09 SMI"

AF=/opt/SUNWsespsw/conf/admin_file

if `pkginfo SUNWmdemo > /dev/null 2>&1` ; then 
  /usr/sbin/pkgrm -n -a $AF SUNWmdemo > /dev/null 2>&1
fi

if `pkginfo SUNWmdoc > /dev/null 2>&1` ; then
  /usr/sbin/pkgrm -n -a $AF SUNWmdoc > /dev/null 2>&1
fi

if `pkginfo SUNWjatodmo > /dev/null 2>&1` ; then
  /usr/sbin/pkgrm -n -a $AF SUNWjatodmo > /dev/null 2>&1
fi

if `pkginfo SUNWjatodoc > /dev/null 2>&1` ; then
  /usr/sbin/pkgrm -n -a $AF SUNWjatodoc > /dev/null 2>&1
fi

SAVE_EDITOR=$EDITOR
EDITOR=ex;export EDITOR
# Remove restart_se6000 out of crontab
while crontab -l | grep restart_se6000 > /dev/null ; do
   /usr/bin/crontab -e << end  > /dev/null
/restart_se6000
d
w
q
end
done

EDITOR=$SAVE_EDITOR;export EDITOR

echo "postpatch completed successfully!"
