#!/bin/sh # #ident "@(#)preremove 1.79 06/09/99 SMI" # # Copyright 06/09/99 Sun Microsystems, Inc. All Rights Reserved # # prepremove script for package: SUNWmhs1 # Exit codes for installation scripts e_ok=0 e_fatal=1 # stop installation on this exit e_warning=2 # Installation will go on. e_int=3 # Interrupted. Stop installation e_reboot=10 # User must reboot after installation of all selected packages e_rebootnow=20 # User must reboot right after installation of current package # To be added to one of the single-digit exit code above # Trap interrupt trap `exit $e_int` 15 AWK=/usr/bin/awk ECHO=/usr/bin/echo GREP=/usr/bin/grep PS=/usr/bin/ps WC=/usr/bin/wc CRONTAB=/usr/bin/crontab # # kill java apps # echo "\nTerminating java apps...\n" pid=`$PS -fe | $GREP deja | $GREP -v grep | $AWK '{print $2}'` if [ -n "$pid" ] then pid2=`$PS -fe | $GREP "$pid" | $GREP jre | $GREP -v grep | $AWK '{print $2}'` if [ -n "$pid2" ] then kill -TERM $pid2 else pid3=`$PS -fe | $GREP "$pid" | $GREP java | $GREP -v grep | $AWK '{print $2}'` if [ -n "$pid3" ] then kill -TERM $pid3 fi fi fi # # Save configuration file : Deja.properties # if [ -f $BASEDIR/SUNWconn/ldap/html/Deja.properties ] then echo "Saving current configuration file under <$BACKUPDIR>" mkdir -p $BACKUPDIR (cd $BASEDIR/SUNWconn/ldap/html/;cp Deja.properties $BACKUPDIR) fi echo "\nPlease wait ...\c" # # # Cleaning all generated files, should be done by the pkgrm # # echo "\nPlease wait ...\c" #rm -f /var/opt/SUNWconn/ldap/log/* #rm -rf /etc/opt/SUNWconn/ldap/previous #rm -f /etc/opt/SUNWconn/ldap/current/sdsadmin.prf #rm -f $BASEDIR/SUNWconn/ldap/html/lib/sunds_port #rm -f $BASEDIR/SUNWconn/html/lib/sunds_port rm -f $BASEDIR/SUNWconn/ldap/html/Deja.prop.old* # # keep the database directory, if you want to remove it later just # uncomment the following line # rm -f /var/opt/SUNWconn/ldap/dbm/* # echo ".\n" # # ADD the needed stuff here for SNMP # #$BASEDIR/SUNWconn/sbin/dsnmpcfg remove # # Remove any reference to dspushd and dspulld deamon in the crontab # #TMPCRONTAB=/tmp/crontab.tmp #test -f "$TMPCRONTAB" && rm "$TMPCRONTAB" #$CRONTAB -l | grep -v "SUNWconn/ldap/lib/dspulld" > $TMPCRONTAB #$CRONTAB -l | grep -v "SUNWconn/ldap/lib/dspushd" > $TMPCRONTAB #$CRONTAB $TMPCRONTAB # #rm -f /var/opt/SUNWconn/admin/* # # Remove remaining html files generated by the JMAPI console # #rm -f $BASEDIR/SUNWconn/ldap/html/lib/COM/Sun/sunsoft/ldaps/*.html #rm -f $BASEDIR/SUNWconn/ldap/html/lib/sunds_port.html # # Remove DBM files generated by the NIS frontend. # #rm -rf /var/opt/SUNWconn/ldap/nis/cache #rm -f /var/opt/SUNWconn/ldap/admin/nis.* # exit $e_ok