#!/sbin/sh
#
#       Subset Control Program for AFAADVGUI subset.

[ `/bin/machine` = alpha ] && . /usr/share/lib/shell/libscp

case $ACT in

M) case $1 in
	-l)	[ `./bin/machine` = "alpha" ] ||
		{
			STL_ScpInit
			Z_BP=`echo $_SUB | sed s/$_VCODE//`

			echo "$Z_BP installs on DEC OSF/1 AXP systems only."
			exit 1
		}
		;;
	esac
	exit 0
	;;

PRE_[LA])
	STL_ScpInit
	Z_BP=`echo $_SUB | sed s/$_VCODE//`

	STL_DepInit

	if STL_DepEval AFAADVDAEMON$_VCODE not
	then
	   echo "For $_SUB to be installed you must first install AFAADVDAEMON$_VCODE."
	   if STL_DepEval AFAADVDAEMON???
	   then
	      echo "In order to install AFAADVDAEMON$_VCODE, you must first"
	      echo "remove the currently installed AFAADVDAEMON subset."
	      echo "Use the command:"
	      echo "      setld -i | grep AFAADVDAEMON | grep installed"
	      echo "to determine the name of the subset to delete."
	   fi
	   exit 1
	fi


	if STL_DepEval OSFCDEMIN4?? not
	then
	   echo "For $_SUB to be installed you must install OSFCDEMIN400 or greater"
	   exit 1
	fi


	if STL_DepEval $Z_BP???
	then
	   if STL_DepEval $_SUB not
	   then
	      echo "You must remove the currently installed $Z_BP subset"
	      echo "before you can install the $_SUB subset."
	      echo "Use the command:"
	      echo "      setld -i | grep $Z_BP | grep installed"
	      echo "to determine the name of the subset to delete."
	      exit 1
	   fi
	fi

	;;

POST_[AL])
	STL_ScpInit
	Z_BP=`echo $_SUB | sed s/$_VCODE//`

	STL_DepInit

	if STL_DepEval $_SUB
	then
	    echo " "
	    echo "Installation of the $_DESC succeeded."
	    echo " "
	else
	    echo " "
	    echo "***"
	    echo "*** Installation of the $_DESC failed."
	    echo "***"
	    echo " "
	fi
        ;;

PRE_D)
	;;

POST_D)
	STL_ScpInit

	echo " "
        echo "The $_DESC was successfully deleted."
        echo " "
        ;;

C)
	case $1 in
	INSTALL)
                echo "
The Advanced File System Graphical User Interface (GUI) includes support
for the License Management Facility (LMF).  A Product Authorization Key
(PAK) is required to use the file-system utilities.  See the AdvFS
Installation Guide for information on registering and activating the PAK.

To start the GUI, enter the command: \"dtadvfs &\".  This executable resides
in the /usr/bin/X11 directory.
"
        ;;
        esac
        ;;
V)
	STL_ScpInit
        echo "
############################################################################
# Copyright  (c)  Digital Equipment Corporation, 1996 All Rights Reserved. #
# Unpublished rights reserved under the copyright  laws  of  the  United   #
# States.   The  software  contained on this media is proprietary to and   #
# embodies the confidential technology of Digital Equipment Corporation.   #
# Possession,  use,  duplication  or  dissemination  of the software and   #
# media is authorized only pursuant to  a  valid  written  license  from   #
# Digital   Equipment   Corporation.    RESTRICTED  RIGHTS  LEGEND  Use,   #
# duplication, or disclosure by  the  U.S.   Government  is  subject  to   #
# restrictions   as  set  forth  in  Subparagraph  (c)(1)(ii)  of  DFARS   #
# 252.227-7013, or  in  FAR  52.227-19,  as  applicable.                   #
############################################################################


This Installation Verification Procedure (IVP) tests the file system
graphical user interface.  You should run the Advanced File System Daemon
IVP (AFAADVDAEMON$_VCODE) before running this IVP.
"

FAILED=0

if [ ! -r ./etc/dt/appconfig/appmanager/C/System_Admin/Storage_Management/Dtadvfs ]
then
    echo "./etc/dt/appconfig/appmanager/C/System_Admin/Storage_Management/Dtadvfs is not readable."
    FAILED=1
fi

if [ ! -r ./etc/dt/appconfig/icons/C/Dtadvfs.l.bm ]
then
	echo "./etc/dt/appconfig/icons/C/Dtadvfs.l.bm is not readable."
	FAILED=1
fi

if [ ! -r ./etc/dt/appconfig/icons/C/Dtadvfs.l.pm ]
then
	echo "./etc/dt/appconfig/icons/C/Dtadvfs.l.pm is not readable."
	FAILED=1
fi

if [ ! -r ./etc/dt/appconfig/icons/C/Dtadvfs.m.bm ]
then
	echo "./etc/dt/appconfig/icons/C/Dtadvfs.m.bm is not readable."
	FAILED=1
fi

if [ ! -r ./etc/dt/appconfig/icons/C/Dtadvfs.m.pm ]
then
	echo "./etc/dt/appconfig/icons/C/Dtadvfs.m.pm is not readable."
	FAILED=1
fi

if [ ! -r ./etc/dt/appconfig/icons/C/Dtadvfs.s.bm ]
then
	echo "./etc/dt/appconfig/icons/C/Dtadvfs.s.bm is not readable."
	FAILED=1
fi

if [ ! -r ./etc/dt/appconfig/icons/C/Dtadvfs.s.pm ]
then
	echo "./etc/dt/appconfig/icons/C/Dtadvfs.s.pm is not readable."
	FAILED=1
fi

if [ ! -r ./etc/dt/appconfig/types/C/Dtadvfs.dt ]
then
	echo "./etc/dt/appconfig/types/C/Dtadvfs.dt is not readable."
	FAILED=1
fi

if [ ! -r ./usr/OV/icons/gifs/advfs.gif ]
then
	echo "./usr/OV/icons/gifs/advfs.gif is not readable."
	FAILED=1
fi

if [ ! -r ./usr/OV/registration/C/advfs ]
then
	echo "./usr/OV/registration/C/advfs is not readable."
	FAILED=1
fi

if [ ! -r ./usr/advfs/AFA$_VCODE_RELNOTES.PS ]
then
	echo "./usr/advfs/AFA$_VCODE_RELNOTES.PS is not readable."
	FAILED=1
fi

if [ ! -r ./usr/advfs/AFA$_VCODE_RELNOTES.TXT ]
then
	echo "./usr/advfs/AFA$_VCODE_RELNOTES.TXT is not readable."
	FAILED=1
fi

if [ ! -x ./usr/bin/X11/dtadvfs ]
then
	echo "./usr/bin/X11/dtadvfs is not executable."
	FAILED=1
fi

if [ ! -x ./usr/bin/X11/dxadvfs ]
then
	echo "./usr/bin/X11/dxadvfs is not executable."
	FAILED=1
fi

if [ ! -r ./usr/lib/nls/msg/en_US.ISO8859-1/AdvFS_GUI.cat ]
then
	echo "./usr/lib/nls/msg/en_US.ISO8859-1/AdvFS_GUI.cat is not readable."
	FAILED=1
fi

if [ ! -r ./usr/dt/appconfig/help/C/advfsmn.sdl ]
then
	echo "./usr/dt/appconfig/help/C/advfsmn.sdl is not readable."
	FAILED=1
fi

if [ ! -d ./var/opt/dtadvfs ]
then
	echo "./var/opt/dtadvfs is not a directory."
	FAILED=1
fi

if [ $FAILED -eq 1 ]
then
    echo "
************************************************************************
One or more files, listed above, that were supposed to be installed with
the $_DESC are not correctly installed.

The $_DESC was not successfully installed.
************************************************************************
"

exit 1
fi

#echo "
#All files are in the correct locations for AFAADVGUI436.
#
#Making sure /usr/bin/X11/dtadvfs runs....
#"
#
#	/usr/bin/X11/dtadvfs -I
#
esac
exit 0
#	End of script
