home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1999 March B
/
SCO_CASTOR4RRT.iso
/
update701
/
install
/
preremove
< prev
next >
Wrap
Text File
|
1998-07-06
|
4KB
|
130 lines
#ident "@(#)preremove 17.2 98/07/06"
#copyright "%c%"
#!/usr/bin/sh
#
# Define any variables needed during package removal
#
BIN=/usr/bin
TTY=/dev/tty
PKGINST=${PKG}
UPDINST=/var/sadm/pkg/${PKGINST}/install
UPDLOGFILE=/var/sadm/install/logs/${PKGINST}.out
UPDTMP=/tmp/${PKGINST}
UPDMENUANS=${UPDTMP}/results
UPDVARFILE=${1}
UPDBKUPDIR=/var/sadm/bkup/${PKGINST}
UPDCNTFILE=${UPDBKUPDIR}/upd.cnt
export TTY UPDINST UPDTMP UPDMENUANS
# Load RC Script
. ${UPDINST}/updpkg.rc
MenuLang
${BIN}/rm -f ${UPDMENUDIR}/working.kill 2>/dev/null
LogMsg "preremove: `GetText STARTED`"
DbgMsg "preremove: Started"
#
# Define trap and trap command for interruption (delete key)
# of the Update Installation
#
TrapCmd ()
{
${BIN}/rm -f ${UPDPKGDIR}/!R-Lock!
MsgHandler 1 UpdIntrMsg
RmExit 3
}
trap 'TrapCmd' 2 3 15
UPD_INSTRM="${UPD_INSTRM_r}"
UPD_instrm="${UPD_instrm_r}"
UPD_INSTRMED="${UPD_INSTRMED_r}"
UPD_BKUPREST="${UPD_BKUPREST_r}"
export UPD_INSTRM UPD_instrm UPD_INSTRMED UPD_BKUPREST
unset UPD_INSTRM_i UPD_instrm_i UPD_INSTRMED_i UPD_BKUPREST_i
unset UPD_INSTRM_r UPD_instrm_r UPD_INSTRMED_r UPD_BKUPREST_r
unset ProcMsg GenericProcMsg
DbgMsg " UPD_INSTRM=${UPD_INSTRM}"
DbgMsg " UPD_instrm=${UPD_instrm}"
DbgMsg " UPD_INSTRMED=${UPD_INSTRMED}"
DbgMsg " UPD_BKUPREST=${UPD_BKUPREST}"
#
# Create temporary work directory.
#
DbgMsg " preremove: remake dir UPDTMP=${UPDTMP}"
${BIN}/rm -rf ${UPDTMP} 2> /dev/null
${BIN}/mkdir -p ${UPDTMP}
#
# Get Desk Top Owners, may have changed since installation.
#
DbgMsg " preremove: exec GetDeskTopOwners"
GetDeskTopOwners
#
# Was a backup taken, if not display menu stating that the
# Update Package CANNOT be removed and exit with failure.
#
DbgMsg " preremove: if backup directories missing, no backup to restore"
UPDCNT=999999
if [ -f ${UPDCNTFILE} ]
then . ${UPDCNTFILE}
while [ "${UPDCNT}" -ge 0 -a -d ${UPDBKUPDIR}/bkup${UPDCNT} ]
do
UPDCNT=`expr ${UPDCNT} - 1`
done
fi
if [ "${UPDCNT}" -ge 0 ]
then
DbgMsg " preremove: no backup, so display nobkup.menu and exit"
MenuCmd warn nobkup
menu_colors regular
MenuClear
LogMsg "preremove: `GetText COMPLEXIT` - ${1}"
DbgMsg "preremove: Completed with exit code - ${1}"
${BIN}/rm -f ${UPDPKGDIR}/!R-Lock!
RmExit 1
fi
#
# Are kernel tools available?
#
DbgMsg " preremove: exec KernelToolsChk"
KernelToolsChk
# ul98-08202 start - why in preremove instead of postremove
CLASSCONF=/sbin/classconf
${CLASSCONF} -D sco dhcp dhcpOsa
${CLASSCONF} -D sco dhcpOptionVendorClass dhcpOsa
DbgMsg "Preremove - ul98-08202: /sbin/classconf"
# ul98-08202 end
# ul98-02137 andrewma/donaldp
[ -f /usr/lib/scoadmin/account/account.tlib ] && {
/sbin/osaconf -A sco accountOsa LOOP_BACK sco_Tcl_osa /usr/lib/scoadmin/account/account.tlib
/sbin/osaconf -A sco accounts LOOP_BACK sco_Tcl_osa /usr/lib/scoadmin/account/account.tlib
/sbin/osaconf -A sco groupOsa LOOP_BACK sco_Tcl_osa /usr/lib/scoadmin/account/account.tlib
/sbin/osaconf -A sco groups LOOP_BACK sco_Tcl_osa /usr/lib/scoadmin/account/account.tlib
DbgMsg " SCOadmin object service agents have been registered with osaconf (account.tlib)"
}
#
# Create lock file for removal of update package so that no
# update overlays are installed until the update package is
# successful removed.
#
DbgMsg " preremove: create a lock file for update removal, ${UPDPKGDIR}/removing"
${BIN}/touch ${UPDPKGDIR}/removing
menu_colors regular
MenuClear
LogMsg "preremove: `GetText COMPLEXIT` - ${1}"
DbgMsg "preremove: Completed with exit code - ${1}"
RmExit 0