#!/bin/sh
#
# Install the new SharedApp executables for Patch 102727-01.
# It saves the original SharedApp executable sharedapp_ui to sharedapp_ui.old
# before it installs the new one.
#

if [ $# -ne 1 ]; then
	echo "Usage: install_patch patch-directory"
	echo "e.g. /tmp/102727-01/install_patch /tmp/102727-01"
	exit 1
fi

if [ ! -d ./SharedApp ]; then
	echo "The SharedApp directory is not in the current directory."
	echo "You should be in .../SUNWsunsol directory.  Please try again."
	exit 1
fi

if [ ! -f $1/SharedApp-2.0.1-patch.tar ]; then
	echo "$1/SharedApp-2.0.1-patch.tar does not exist."
	exit 1
fi

BINDIR=./SharedApp/bin
mv $BINDIR/bin-SUNOS/sharedapp_ui $BINDIR/bin-SUNOS/sharedapp_ui.old
mv $BINDIR/bin-SVR4/sharedapp_ui $BINDIR/bin-SVR4/sharedapp_ui.old
tar xvf $1/SharedApp-2.0.1-patch.tar
exit 0
