1*9567SBill.Taylor@Sun.COM#!/sbin/sh 2*9567SBill.Taylor@Sun.COM# 3*9567SBill.Taylor@Sun.COM# CDDL HEADER START 4*9567SBill.Taylor@Sun.COM# 5*9567SBill.Taylor@Sun.COM# The contents of this file are subject to the terms of the 6*9567SBill.Taylor@Sun.COM# Common Development and Distribution License (the "License"). 7*9567SBill.Taylor@Sun.COM# You may not use this file except in compliance with the License. 8*9567SBill.Taylor@Sun.COM# 9*9567SBill.Taylor@Sun.COM# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10*9567SBill.Taylor@Sun.COM# or http://www.opensolaris.org/os/licensing. 11*9567SBill.Taylor@Sun.COM# See the License for the specific language governing permissions 12*9567SBill.Taylor@Sun.COM# and limitations under the License. 13*9567SBill.Taylor@Sun.COM# 14*9567SBill.Taylor@Sun.COM# When distributing Covered Code, include this CDDL HEADER in each 15*9567SBill.Taylor@Sun.COM# file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16*9567SBill.Taylor@Sun.COM# If applicable, add the following below this CDDL HEADER, with the 17*9567SBill.Taylor@Sun.COM# fields enclosed by brackets "[]" replaced with your own identifying 18*9567SBill.Taylor@Sun.COM# information: Portions Copyright [yyyy] [name of copyright owner] 19*9567SBill.Taylor@Sun.COM# 20*9567SBill.Taylor@Sun.COM# CDDL HEADER END 21*9567SBill.Taylor@Sun.COM# 22*9567SBill.Taylor@Sun.COM# 23*9567SBill.Taylor@Sun.COM# Copyright 2003 Sun Microsystems, Inc. All rights reserved. 24*9567SBill.Taylor@Sun.COM# Use is subject to license terms. 25*9567SBill.Taylor@Sun.COM# 26*9567SBill.Taylor@Sun.COM 27*9567SBill.Taylor@Sun.COM# First read the /etc/dat/dat.conf file to see if it has already been 28*9567SBill.Taylor@Sun.COM# populated by the service provider entry. If so, simply return. If not, 29*9567SBill.Taylor@Sun.COM# run datadm to populate the dat.conf file 30*9567SBill.Taylor@Sun.COMif [ -r /etc/dat/dat.conf ]; then 31*9567SBill.Taylor@Sun.COM pattern="driver_name=" 32*9567SBill.Taylor@Sun.COM [ `/usr/bin/grep -c "$pattern" /etc/dat/dat.conf` -ge 1 ] && exit 0 33*9567SBill.Taylor@Sun.COMelse 34*9567SBill.Taylor@Sun.COM echo "WARNING: /etc/dat/dat.conf is missing or unreadable" >& 2 35*9567SBill.Taylor@Sun.COM exit 1 36*9567SBill.Taylor@Sun.COMfi 37*9567SBill.Taylor@Sun.COM 38*9567SBill.Taylor@Sun.COM# Now /etc/dat/dat.conf is readable but does not contain an entry for the 39*9567SBill.Taylor@Sun.COM# service provider. So, run datadm -a /usr/share/dat/SUNWudaplt.conf to 40*9567SBill.Taylor@Sun.COM# populate dat.conf 41*9567SBill.Taylor@Sun.COMif [ -x /usr/sbin/datadm ]; then 42*9567SBill.Taylor@Sun.COM if [ -r /usr/share/dat/SUNWudaplt.conf ]; then 43*9567SBill.Taylor@Sun.COM /usr/sbin/datadm -a /usr/share/dat/SUNWudaplt.conf 44*9567SBill.Taylor@Sun.COM else 45*9567SBill.Taylor@Sun.COM echo "WARNING: SUNWudaplt.conf is missing or unreadable" >& 2 46*9567SBill.Taylor@Sun.COM exit 1 47*9567SBill.Taylor@Sun.COM fi 48*9567SBill.Taylor@Sun.COMelse 49*9567SBill.Taylor@Sun.COM echo "WARNING: /usr/sbin/datadm is missing or not executable" >& 2 50*9567SBill.Taylor@Sun.COM exit 1 51*9567SBill.Taylor@Sun.COMfi 52