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