#!/usr/bin/sh
# IBM_PROLOG_BEGIN_TAG 
# This is an automatically generated prolog. 
#  
# bos720 src/bos/usr/bin/cdat/smit/cdat_default_values.sh 1.2 
#  
# Licensed Materials - Property of IBM 
#  
# COPYRIGHT International Business Machines Corp. 2010,2011 
# All Rights Reserved 
#  
# US Government Users Restricted Rights - Use, duplication or 
# disclosure restricted by GSA ADP Schedule Contract with IBM Corp. 
#  
# IBM_PROLOG_END_TAG 
# @(#)33    1.2  src/bos/usr/bin/cdat/smit/cdat_default_values.sh, cdat, bos720 7/14/11 20:14:20
# This command returns the default values (used by smit cmd_to_discover)
#
# If cdat is not initialized, the command fails

PATH=/bin:/sbin:/usr/bin:/usr/sbin

[ $# -gt 1 ] && \
	echo "Usage: $0 [-f]" && exit 1
[ $# -eq 1 -a "$1" != "-f" ] && \
	echo "Usage: $0 [-f]" && exit 1

ODMDIR=/etc/objrepos
DIR=`/usr/bin/odmget -qattribute=cdat_directory SWservAt | \
	awk '
	$1=="value" && $3!="\"\"" {
		gsub( "\"", "", $3)
		print $3
		exit 0
	}'`
[ -z "$DIR" ] && exit 1

FILE="${DIR}/nodes.txt"

if [ $# -eq 1 ]
then
	echo "$FILE"
else
	echo "#user:node_file"
	echo "cdat:$FILE"
fi
exit 0
