#!/bin/ksh # # $Revision: 1.5 $ # $Date: 2004/10/19 00:53:32 $ # LANG=C export LANG if [ "$PKG_INSTALL_ROOT" = "/" ]; then PKG_INSTALL_ROOT="" fi # stop console agent and dr, also remove user ssmon,ssadmin,ssconfig if [ "${PKG_INSTALL_ROOT:-/}" = "/" ]; then # for agent if [ -f /etc/init.d/ssagent ]; then /etc/init.d/ssagent stop kindly || exit 1 fi removeuser() { # removeuser will # First it can judge the user exist or not # Second it can remove the user. uname=$1; shift getent passwd $uname >/dev/null && { userdel $uname >/dev/null && { echo "User $uname has been removed!" } } } removeuser ssmon removeuser ssconfig removeuser ssadmin echo "" # for console cd ${PKG_INSTALL_ROOT}/opt/SUNWsscs/sscsconsole ./sscs stop # for dr ssdgrptpop stop ssdgrptui stop ssdgrptd stop fi ## for console. # # Please modify the SAVE_FILE_LIST when you want to save other files. # SAVE_FILE_LIST="browser.default cfgsavset errlog.txt eventlog.txt svrlist.dat serial.txt" cd ${PKG_INSTALL_ROOT}/opt/SUNWsscs/sscsconsole tar cf sscscon.cfg.tar $SAVE_FILE_LIST >/dev/null 2>&1 if [ ! -d ${PKG_INSTALL_ROOT}/var/opt/SUNWsscs ]; then mkdir -p ${PKG_INSTALL_ROOT}/var/opt/SUNWsscs 2>&1 >/dev/null fi cp -f sscscon.cfg.tar ${PKG_INSTALL_ROOT}/var/opt/SUNWsscs/ >/dev/null 2>&1 rm -f sscscon.cfg.tar # remove any exist files to make pkgrm can remove the dir. rm -rf * ## for agent. # # Please modify the SAVE_FILE_LIST when you want to save other files. # SAVE_FILE_LIST="sstrapd.conf lunfilter.txt ssagent.cfg sscontlr.txt ssagent.spc" cd ${PKG_INSTALL_ROOT}/var/opt/SUNWsscs/ssagent tar cf ${PKG_INSTALL_ROOT}/tmp/sscsagt.cfg.tar $SAVE_FILE_LIST >/dev/null 2>&1 if [ ! -d ${PKG_INSTALL_ROOT}/var/opt/SUNWsscs ]; then mkdir -p ${PKG_INSTALL_ROOT}/var/opt/SUNWsscs 2>&1 >/dev/null fi cp -f ${PKG_INSTALL_ROOT}/tmp/sscsagt.cfg.tar ${PKG_INSTALL_ROOT}/var/opt/SUNWsscs/sscsagt.cfg.tar >/dev/null 2>&1 rm -f ${PKG_INSTALL_ROOT}/tmp/sscsagt.cfg.tar rm -rf ${PKG_INSTALL_ROOT}/var/opt/SUNWsscs/ssagent >/dev/null 2>&1 ## for dr ui # # Please modify the SAVE_FILE_LIST when you want to save other files. # SAVE_FILE_LIST="pop3.cfg svrlist.dat browser.default" cd ${PKG_INSTALL_ROOT}/opt/SUNWsscs/ssdiagreporterui tar cf ssdgrptui.cfg.tar $SAVE_FILE_LIST >/dev/null 2>&1 if [ ! -d ${PKG_INSTALL_ROOT}/var/opt/SUNWsscs ]; then mkdir -p ${PKG_INSTALL_ROOT}/var/opt/SUNWsscs 2>&1 >/dev/null fi cp -f ssdgrptui.cfg.tar ${PKG_INSTALL_ROOT}/var/opt/SUNWsscs/ >/dev/null 2>&1 rm -f ssdgrptui.cfg.tar rm -rf Mail* *.log *tmp* svrlist.* *.cfg browser.default >/dev/null 2>&1 ## for dr daemon # # Please modify the SAVE_FILE_LIST when you want to save other files. # may be we should not save errlog.txt,eventlog.txt and mailed.log. SAVE_FILE_LIST="errlog.txt eventlog.txt mailed.log ssdgrpt_cfg.xml ssdgrcli.cfg" cd ${PKG_INSTALL_ROOT}/opt/SUNWsscs/ssdiagreporterd tar cf ssdgrptd.cfg.tar $SAVE_FILE_LIST >/dev/null 2>&1 if [ ! -d ${PKG_INSTALL_ROOT}/var/opt/SUNWsscs ]; then mkdir -p ${PKG_INSTALL_ROOT}/var/opt/SUNWsscs 2>&1 >/dev/null fi cp -f ssdgrptd.cfg.tar ${PKG_INSTALL_ROOT}/var/opt/SUNWsscs/ >/dev/null 2>&1 rm -f ssdgrptd.cfg.tar rm -rf *.txt* *.log* *tmp* *xml *hel *HEL ssdgrcli.cfg >/dev/null 2>&1 exit 0