#!/bin/sh -f

cd $INST_DATADIR/$PKG/reloc
module=modules/fwmod.5.5.o

now=`date +%y%m%d-%H:%M.%S`
product="Solstice FireWall-1"
version="v3.0"
hpux=0
aix=0
shell_if="if"
OSREL=`/usr/bin/uname -r | sed 's/\./\ /' | awk '{print $1}'`
pprefix=/tmp/fw-1

if [ $OSREL -eq 5 ]; then
    solaris2=1
    sunos4=0
else
    solaris2=0
    sunos4=1
fi


firewall=$FireWall
management=$Management
fwlink=$Fwlink
grpdef=$Grpdef
grpset=$Grpset

ans=$Ans
tmpdir=$FW_PKGSAV
export firewall management
export grpdef grpset fwlink ans tmpdir hpux solaris2 product version 
export now module sunos4 shell_if aix

if [ $Shutdown = 1 ]; then
	scripts/fwshutdown
fi

if [ "$ans" = "u" ]; then
	upgrade=1
fi

if [ "$Fwlink" = "1" ]; then
	scripts/setfwlink
fi

/bin/mv $pprefix/conf/product.conf $BASEDIR/conf/product.conf
scripts/linkmodule

if [ "$ans" = "u" ]; then
	export upgrade
	yn=$Yn
	export yn
	scripts/fwmerge dummy
fi

if [ "$grpset" != "" ]; then
	grp=$grpset
	export grp
	scripts/setgroup
fi

scripts/kmodule

if [ "$Bootmodifications" = "true" ]; then
	echo "Changing rc file"
	rcfile=$Rcfile
	bootmodifications="true"
	export rcfile bootmodifications
	scripts/setrc
fi

	noipfwd=$Noipfwd
	if [ "$noipfwd" != "0" ]; then
		echo "Disabling ipforwarding"
	fi
	bootmodifications="true"
	export noipfwd bootmodifications
	scripts/setipfwd

	chmod ug+x $BASEDIR/scripts/*

echo ""
echo "*******************************************************************************"
echo "                        DON'T FORGET TO:"
echo "1. add the line:    setenv FWDIR $FWDIR		to .cshrc"
echo "                or  FWDIR=$FWDIR; export FWDIR	to .profile"
echo "2. add  \$FWDIR/bin  to path"
echo "3. add  \$FWDIR/man  to MANPATH environment"
echo "*******************************************************************************"
echo ""

echo "-------------------------------------------------------------------------------"
echo "Note:   This product requires separate installation of a license before"
echo "        use. Please consult your Solstice FireWall-1 Administrator's"
echo "        Guide for information on how to obtain and install a license"
echo "        for Solstice FireWall-1."
echo "-------------------------------------------------------------------------------"
echo ""

echo "-------------------------------------------------------------------------------"
echo "Important:    Please run fwconfig to install the license and to "
echo "              configure $product. "
echo "-------------------------------------------------------------------------------"

exit 0



