#!/bin/sh
#*******************************************************************************
#  Copyright 1998 Symbios Inc.  All Rights reserved.                           *
#  This file is confidential and a trade secret of Symbios Inc.  The receipt   *
#  or possession of this file does not convey any rights to reproduce or       *
#  disclose its contents or to manufacture, use, or sell anything it may       *
#  describe, in whole, or in part, without the specific written consent of     *
#  Symbios Inc.                                                                *
#*******************************************************************************

#*******************************************************************************
#
# NAME:		S61rdaclinks
# VERSION:	rm6_1
# UPDATE DATE:	%date_modified: Mon Aug 28 09:30:07 2000 %
# INSPECTED ON:
#
# CONTACTS:
#   Originator:
#   Owner:
#   Backup:
#   Updater:	%created_by:    mgallagh %
#
# DESCRIPTION:
#
#
# NOTES:
#
#
# REFERENCE:
# 1.  Source Code Integrity Measures
#
#
# CODING STANDARD WAIVERS:
#
#
#*******************************************************************************

#*******************************************************************************
# PROCEDURE:	
#
# DESCRIPTION: Executes after S60devlinks in the Solaris boot proceedure.
#	       It corrects the /dev/[r]dsk directories for RDAC
#
# SYNTAX:
#
#
# NOTES:  It goes in the /etc/rcS.d directory
#
#
# RETURNS:
#
#

rm -f /S61rdaclinks.msg

if [ -f /var/adm/messages ]
then
	output_file=/var/adm/messages
else
	output_file=/tmp/S61rdaclinks.msg
fi

(
RMPARAMS_FILE=/etc/raid/rmparams
RM_BOOT_HOME=`grep -v "^#" $RMPARAMS_FILE | grep System_RmBootHomeDirectory | cut -d= -f2`

if [ -n "$_INIT_RECONFIG" ]; then
        echo "Configuring the RAID devices"

	`grep -v "^#" $RMPARAMS_FILE | grep "Rdac_RdacDisksDisable.*=.*TRUE" >/dev/null 2>&1`
	if [ $? -eq 0  ] 
	then
		if [ -d /usr/lib/devfsadm/linkmod ]
		then
			`ls /usr/lib/devfsadm/linkmod | grep RAIDarray >/dev/null 2>$1`
			if [ $? -eq 0  ]
			then
				disks >/dev/null 2>&1
			fi
		fi
	fi
        $RM_BOOT_HOME/rdac_disks
fi
) 2>&1 |
while read line
do
	echo "$line"

	string=`date '+%b %d %H:%M:%S'`" "`uname -n`
	echo "$string $line" >>$output_file
done
