#!/sbin/sh
# postremove script for the iasyS,asycS, sysSp drivers for the Advanced 
# Management Device Driver 

FAILURE=1  #This indicates fatal error
SUCCESS=0  #This indicates success
WARNING=2  #Warning or possible error condition
REBOOT=10  #System should be rebooted
CONFBIN=/etc/conf/bin
DIR_IASYS=iasys
DIR_ASYCS=asycs
DIR_SYSSP=syssp
DRIVER_SYSSP=sysSp
DRIVER_IASYS=iasyS
DRIVER_ASYCS=asycS
ERR=/tmp/err.$
DCU=/sbin/dcu

${CONFBIN}/idcheck -p ${DRIVER_IASYS}
RES="$?"
${CONFBIN}/idcheck -p ${DRIVER_ASYCS}
RES1="$?"
${CONFBIN}/idcheck -p ${DRIVER_SYSSP}
RES2="$?"

if
[ "${RES}" -ne "100" -a "${RES}" -ne "0" ]
then
  #Drivers is installed so de-install it
  ${CONFBIN}/idinstall -P ${PKGINST} -d ${DRIVER_IASYS} 2>> /dev/null	
fi
  
if
[ "${RES1}" -ne "100" -a "${RES1}" -ne "0" ]
then
  #Drivers is installed so de-install it
  ${CONFBIN}/idinstall -P ${PKGINST} -d ${DRIVER_ASYCS} 2>> /dev/null
fi
  
if
[ "${RES2}" -ne "100" -a "${RES2}" -ne "0" ]
then
  #Drivers is installed so de-install it
  ${CONFBIN}/idinstall -P ${PKGINST} -d ${DRIVER_SYSSP} 2>> /dev/null  
fi  

${CONFBIN}/idbuild  >/dev/null 2>&1
removef -f ${PKGINST}

if [ $INSTALL_ICONS -a  $INSTALL_ICONS = FALSE ]
 then
 
gettxt :814 "\\n*** IMPORTANT NOTICE ***\\n\\tIf removal of all desired packa\
ges is complete,\\n\\tthe machine should be rebooted in order to\\n\\tensure san\
e operation. Execute the shutdown\\n\\tcommand with the appropriate options to r\
eboot.\n" >$TEMPVAR 


echo $TEMPVAR
    
#gettxt :1 "\\nStrike the ENTER key to continue\n" >$TEMPVAR
    
#echo $TEMPVAR
    
#read -r TEMPVAR

exit 0

fi

exit ${REBOOT}
