#!/sbin/sh -

vers=`uname -r`

if [ "$vers" = "5.6" ]
	then
		vers=26
	else 
		vers=25
fi

#Ask if DM version is being used on this client
echo "\n Please select one of the following:"
echo "\n   1. Enterprise HSM for Veritas VxFS file system "
echo "   2. Enterprise HSM for Solaris UFS file system  "
echo "\n Default [2] (1 or 2) \c"
read response

if [ "$response" = "1" ] 
then
		echo ".......Installing binaries for VxFS"

		if [ -s /usr/openv/hsm/bin/bpbkar ]
		then
       			/usr/bin/mv /usr/openv/hsm/bin/bpbkar /usr/openv/hsm/bin/bpbkar.b4patch107604-02 
       		fi
       			
		if [ -s /usr/openv/hsm/bin/convert_ihand ]
		then
       			/usr/bin/mv /usr/openv/hsm/bin/convert_ihand /usr/openv/hsm/bin/convert_ihand.b4patch107604-02 
       		fi
       		
		if [ -s /usr/openv/hsm/bin/install.hsm ]
		then
       			/usr/bin/mv /usr/openv/hsm/bin/install.hsm /usr/openv/hsm/bin/install.hsm.b4patch107604-02 
       		fi
       		
		if [ -s /usr/openv/hsm/bin/tar ] && [ "$vers" = "25" ]
		then
       			/usr/bin/mv /usr/openv/hsm/bin/tar /usr/openv/hsm/bin/tar.b4patch107604-02 
       		fi
       		
		if [ -s /usr/openv/hsm/bin/migreconstruct ]
		then
       			/usr/bin/mv /usr/openv/hsm/bin/migreconstruct /usr/openv/hsm/bin/migreconstruct.b4patch107604-02 
       		fi
       		
		if [ -s /usr/openv/hsm/bin/admincmd/migcompress ]
		then
       			/usr/bin/mv /usr/openv/hsm/bin/admincmd/migcompress /usr/openv/hsm/bin/admincmd/migcompress.b4patch107604-02 
       		fi
       		
		if [ -s /usr/openv/hsm/bin/admincmd/migcopy ]
		then
       			/usr/bin/mv /usr/openv/hsm/bin/admincmd/migcopy /usr/openv/hsm/bin/admincmd/migcopy.b4patch107604-02 
       		fi
       		
		if [ -s /usr/openv/hsm/bin/admincmd/migdbclean ]
		then
       			/usr/bin/mv /usr/openv/hsm/bin/admincmd/migdbclean /usr/openv/hsm/bin/admincmd/migdbclean.b4patch107604-02 
       		fi
       		
		if [ -s /usr/openv/hsm/bin/goodies/convert_ihand.sh ]
		then
       			/usr/bin/mv /usr/openv/hsm/bin/goodies/convert_ihand.sh /usr/openv/hsm/bin/goodies/convert_ihand.sh.b4patch107604-02 
       		fi
       		
		if [ -s /usr/openv/hsm/bin/solaris_dm_26/migattr.o ] && [ "$vers" = "26" ]
		then
       			/usr/bin/mv /usr/openv/hsm/bin/solaris_dm_26/migattr.o /usr/openv/hsm/bin/solaris_dm_26/migattr.o.b4patch107604-02 
       		fi
       		

       		/usr/bin/cp -r /usr/openv/hsm/bin.dm.${vers}/* /usr/openv/hsm/bin/
       		/usr/bin/rm -r /usr/openv/hsm/bin.dm* /usr/openv/hsm/bin.sol*
       			
       			
else
	echo ".......Installing binaries for ufs"
	

		if [ -s /usr/openv/hsm/bin/tar ] && [ "$vers" = "25" ] 
		then
       			/usr/bin/mv /usr/openv/hsm/bin/tar /usr/openv/hsm/bin/tar.b4patch107604-02 
       		fi
       		
		if [ -s /usr/openv/hsm/bin/migreconstruct ]
		then
       			/usr/bin/mv /usr/openv/hsm/bin/migreconstruct /usr/openv/hsm/bin/migreconstruct.b4patch107604-02 
       		fi
       		
		if [ -s /usr/openv/hsm/bin/admincmd/migcompress ]
		then
       			/usr/bin/mv /usr/openv/hsm/bin/admincmd/migcompress /usr/openv/hsm/bin/admincmd/migcompress.b4patch107604-02 
       		fi
       		
		if [ -s /usr/openv/hsm/bin/admincmd/migcopy ] && [ "$vers" = "25" ]
		then
       			/usr/bin/mv /usr/openv/hsm/bin/admincmd/migcopy /usr/openv/hsm/bin/admincmd/migcopy.b4patch107604-02 
       		fi
       		
		if [ -s /usr/openv/hsm/bin/admincmd/migd ]
		then
       			/usr/bin/mv /usr/openv/hsm/bin/admincmd/migd /usr/openv/hsm/bin/admincmd/migd.b4patch107604-02 
       		fi
       		
		if [ -s /usr/openv/hsm/bin/admincmd/migtrans ] && [ "$vers" = "25" ]
		then
       			/usr/bin/mv /usr/openv/hsm/bin/admincmd/migtrans /usr/openv/hsm/bin/admincmd/migtrans.b4patch107604-02 
       		fi
       		
		if [ -s /usr/openv/hsm/bin/solaris_25/mig.o ] && [ "$vers" = "25" ]
		then
       			/usr/bin/mv /usr/openv/hsm/bin/solaris_25/mig.o /usr/openv/hsm/bin/solaris_25/mig.o.b4patch107604-02 
       		fi
       		
		if [ -s /usr/openv/hsm/bin/solaris_25u/mig.o ] && [ "$vers" = "25" ]
		then
       			/usr/bin/mv /usr/openv/hsm/bin/solaris_25u/mig.o /usr/openv/hsm/bin/solaris_25u/mig.o.b4patch107604-02 
       		fi
       		
		if [ -s /usr/openv/hsm/bin/bpbkar ] && [ "$vers" = "26" ]
		then
       			/usr/bin/mv /usr/openv/hsm/bin/bpbkar /usr/openv/hsm/bin/bpbkar.b4patch107604-02 
       		fi
       			
		if [ -s /usr/openv/hsm/bin/install.hsm ] && [ "$vers" = "26" ]
		then
       			/usr/bin/mv /usr/openv/hsm/bin/install.hsm /usr/openv/hsm/bin/install.hsm.b4patch107604-02 
       		fi

		if [ -s /usr/openv/hsm/bin/pfconvert ] && [ "$vers" = "26" ]
		then
       			/usr/bin/mv /usr/openv/hsm/bin/pfconvert /usr/openv/hsm/bin/pfconvert.b4patch107604-02 
       		fi
       		
		if [ -s /usr/openv/hsm/bin/admincmd/pfconvert.sh ] && [ "$vers" = "26" ]
		then
       			/usr/bin/mv /usr/openv/hsm/bin/admincmd/pfconvert.sh /usr/openv/hsm/bin/admincmd/pfconvert.sh.b4patch107604-02 
       		fi
       		
       		if [ -s /usr/openv/hsm/bin/solaris_26/mig.o ] && [ "$vers" = "26" ]
		then
       			/usr/bin/mv /usr/openv/hsm/bin/solaris_26/mig.o /usr/openv/hsm/bin/solaris_26/mig.o.b4patch107604-02 
       		fi
       		
		if [ -s /usr/openv/hsm/bin/solaris_26m/mig.o ] && [ "$vers" = "26" ]
		then
       			/usr/bin/mv /usr/openv/hsm/bin/solaris_26m/mig.o /usr/openv/hsm/bin/solaris_26m/mig.o.b4patch107604-02 
       		fi
       		

       		/usr/bin/cp -r /usr/openv/hsm/bin.sol.${vers}/* /usr/openv/hsm/bin/
       		/usr/bin/rm -r /usr/openv/hsm/bin.dm* /usr/openv/hsm/bin.sol*

 	
fi


