unglb #1

  • //
  • guest/
  • yariv_sheizaf/
  • scripts/
  • unglb
  • View
  • Commits
  • Open Download .zip Download (4 KB)
#!/sbin/sh
#
#####################################################################################
# Name		: /public/scripts/unglb
# Purpose	: Stop GlobeCom services, then uninstall Globecom software components
# BY		: Yariv Sheizaf
# Date		: 22-Jul-2001
#####################################################################################

if [ "$USER" != "root" ]
then
	echo ""
	echo "$0 should be run with user root. Exit..."
	echo ""
	exit 1
fi


PWD=`pwd`
if [ "$PWD" = "/public/scripts" ]
then
	echo ""
	echo "Can not run when located in /public/scripts. Exit..."
	echo ""
	exit 1
fi


cd

## Operating system type
SYS=`uname`

## Find Resource directory 
RESDIR=`grep Alias /usr/local/gwa/conf/httpd.conf | grep zax | awk '{print $NF}' | sed 's?/zax/??'`


## Stop Globecom services
echo ""
echo "Stop Globecom services"
/public/scripts/glbservices stop

## Verify that all Globecom services were stopped
sleep 5
ISSTOPPED=`/public/scripts/psdm | wc -l | awk '{print $NF}'`
if [ "$ISSTOPPED" != "2" ]
then
	echo ""
	echo "Not all Globecom servcies were stopped:"
	/public/scripts/psdm
	echo "Exit..."
	echo ""
	exit 1
fi

NOGCDIR=/usr/local/nogc
if [ ! -d $NOGCDIR ]
then
	mkdir $NOGCDIR
fi


## Remove Globecom software components
echo "Remove /usr/local/gwa"
rm -rf /usr/local/gwa

## Remove files from /usr/local/apache/libexec
echo "Remove Globecom *.so files from /usr/local/apache/libexec"
rm -f /usr/local/apache/libexec/pici.so
rm -f /usr/local/apache/libexec/rus.so
rm -f /usr/local/apache/libexec/sda.so
rm -f /usr/local/apache/libexec/zax.so
rm -f /usr/local/apache/libexec/poll.so
rm -f /usr/local/apache/libexec/sdu.so
rm -f /usr/local/apache/libexec/sduack.so
rm -f /usr/local/apache/libexec/sduhalt.so
rm -f /usr/local/apache/libexec/sdustat.so


## Remove Apache log files 
echo "Remove Apache log files from /usr/local/apache/log"
rm -rf /usr/local/apache/log/*log*


## Remove scripts from /etc/init.d
echo "Remove /etc/init.d/wlsrv"
if [ "$SYS" = "Linux" ]
then
	rm -f /etc/rc.d/init.d/wlsrv
else
	rm -f /etc/init.d/wlsrv
fi 

## Remove files from resources directory
echo "Remove resources directory content"
rm -rf /data/var/*

## Remove files from /var/run
echo "Remove /var/run content"
rm -rf /var/run/*

## Clean Weblogic environment
echo "Remove Globecom files from /install/weblogic"
rm -rf /install/weblogic/servlets_logs
rm -rf /install/weblogic/secured
rm -rf /install/weblogic/images
rm -rf /install/weblogic/help
rm -rf /install/weblogic/classes/globecom
rm -rf /install/weblogic/classes/Jars

## Remove files from FTP directory
echo "Remove Globecom files from FTP storage directory"
rm -rf /install/ftp/publisher

## Remove temporary configuration files directory
echo "Remove /tmp/gc-conf"
rm -rf /tmp/gc-conf

## Rollback to original Apache configuration files
echo "Rollback Apache configuration files to NON-Globecom structure"
if [ -f $NOGCDIR/httpd.conf ]
then
	rm -f /usr/local/apache/conf/httpd.conf 
	mv $NOGCDIR/httpd.conf /usr/local/apache/conf/httpd.conf
else
	cp /usr/local/apache/conf/httpd.conf $NOGCDIR/httpd.conf
fi

JSERVDIR=/usr/local/apache/conf/jserv
if [ -d $JSERVDIR ]
then
	cd $JSERVDIR
	for i in jserv.conf jserv.properties zone.properties
	do
	    if [ -f $NOGCDIR/$i ]
	    then
		rm -f $i 
		mv $NOGCDIR/$i $i
	    else
		cp $i $NOGCDIR/$i
    	    fi
	done
fi

cd


## Rollback to original Weblogic files
echo "Remove Globecom files from Weblogic directory"
rm -f /install/weblogic/Admin.html
rm -f /install/weblogic/Cancel.html
rm -f /install/weblogic/EJB_Param.ini
rm -rf /install/weblogic/MgsLogFiles_new
rm -rf /install/weblogic/MgsLogFiles_old

WEBLDIR=/install/weblogic
cd $WEBLDIR
echo "Rollback Weblogic files to NON-Globecom structure"
for i in weblogic.properties startWebLogic.sh shutWebLogic.sh
do
    if [ -f $NOGCDIR/$i ]
    then
	rm -f $i 
	mv $NOGCDIR/$i $i
    else
	cp $i $NOGCDIR/$i
    fi
done
cd


## Remove Globecom Weblogic clutser tree
echo "Remove Globecom Weblogic cluster directory"
rm -rf /install/weblogic/gccluster


## Rollback to original Real-Server configuration file
echo "Rollback Real-Server configuration file to NON-Globecom structure"
if [ -f $NOGCDIR/rmserver.cfg ]
then
	rm -f /usr/local/real/rmserver.cfg 
	mv $NOGCDIR/rmserver.cfg /usr/local/real/rmserver.cfg
else
	cp /usr/local/real/rmserver.cfg $NOGCDIR/rmserver.cfg
fi

cd

## Remove files from /public
#echo "Remove /public/<configuration>/ins, /public/pkg, /public/scripts"
#rm -rf /public/*/ins
#rm -rf /public/pkg
#rm -rf /public/scripts


exit 0
# Change User Description Committed
#1 1472 Yariv Sheizaf scripts dir