#!/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 #if [ -f /etc/init.d/init.dsnmpserv ] #then # /etc/init.d/init.dsnmpserv stop #fi if [ -f $BASEDIR/SUNWconn/ldap/sbin/init.dsnmprad ] then $BASEDIR/SUNWconn/ldap/sbin/init.dsnmprad stop fi if [ -f $BASEDIR/SUNWconn/ldap/sbin/dsradius ] then $BASEDIR/SUNWconn/ldap/sbin/dsradius stop fi pid=`$PS -fe | $GREP lib/dsnmp | $GREP -v grep | $AWK '{print $2}'` if [ -n "$pid" ] then kill -TERM $pid fi # # Backup configuration # if [ -f /etc/opt/SUNWconn/ldap/current/dsradiusd.conf ] echo "Not backuping configuration" then echo "Saving current configuration file under <$BACKUPDIR>" mkdir -p $BACKUPDIR mkdir -p $BACKUPDIR/mapping (cd $ETCDIR/current; cp dsradiusd.conf $BACKUPDIR) (cd $ETCDIR/current; cp acctattr $BACKUPDIR) (cd $ETCDIR/current; cp dictionary $BACKUPDIR) (cd $ETCDIR/current/mapping; cp radius.mapping $BACKUPDIR/mapping) fi echo "\nPlease wait ...\c" echo "" echo "If you didn't deregister the Radius Console, remove the entry" echo "cn=Sun RADIUS Server,cn=Server Group,cn=,ou=,o=NetscapeRoot" echo "and all it's subentries from the administration server." echo "" # # # 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 exit $e_ok