Current File : //etc/rc2.d/S81dodatadm.udaplt
#!/sbin/sh
#
# Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
#

# First read the /etc/dat/dat.conf file to see if it has already been
# populated by the service provider entry. If so, simply return. If not,
# run datadm to populate the dat.conf file
if [ -r /etc/dat/dat.conf ]; then
	pattern="driver_name="
	[ `/usr/bin/grep -c "$pattern" /etc/dat/dat.conf` -ge 1 ] && exit 0
else
	echo "WARNING: /etc/dat/dat.conf is missing or unreadable" >& 2
	exit 1
fi

# Now /etc/dat/dat.conf is readable but does not contain an entry for the
# service provider. So, run datadm -a /usr/share/dat/SUNWudaplt.conf to 
# populate dat.conf
if [ -x /usr/sbin/datadm ]; then
	if [ -r /usr/share/dat/SUNWudaplt.conf ]; then
		/usr/sbin/datadm -a /usr/share/dat/SUNWudaplt.conf
		exit 0
	else
		echo "WARNING: SUNWudaplt.conf is missing or unreadable" >& 2
		exit 1
	fi
else
	echo "WARNING: /usr/sbin/datadm is missing or not executable" >& 2
	exit 1	
fi