#!/bin/ksh
#
# Copyright (c) 2001 by Sun Microsystems, Inc.
# All rights reserved.
#
#ident	"@(#)add_quorum	1.3	01/02/05 SMI"
#
# This scripts run after the rebooting of the node. It is assumed that
# the node has Solaris 8 and SC3.0 installed and up and running.

set -A allnodes

/usr/cluster/bin/scdidadm -L | awk -F: '{print $1}' | sort -n \
	| while read id node; do
	if [[ ${last_id} = "" ]]; then
		last_id=0
	fi

	if [[ ${last_node} = "" ]]; then
        	last_node=0
	fi

	if [[ ${config} = "" ]]; then
        	config=0
	fi

	if [[ ${id} -eq ${last_id} ]]; then
		if [[ $oldconfig != $config ]]; then
			/usr/cluster/bin/scconf -a -q globaldev=d$id
			config="${node}:${last_node}"
		fi	
		oldconfig="${node}:${last_node}"
	else
        	last_id=${id}
        	last_node=${node}
	fi
done

/usr/cluster/bin/scconf -c -q reset
