#! /bin/ksh
# IBM_PROLOG_BEGIN_TAG 
# This is an automatically generated prolog. 
#  
#  
#  
# Licensed Materials - Property of IBM 
#  
# (C) COPYRIGHT International Business Machines Corp. 1999,2007 
# 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 
#
#* CPRY
#
# @(#)82   1.4         src/rsct/pgs/cmds/hagsns.sh, gsctrl, rsct_relgh, relghs001a 2/27/06 22:11:03
#*======================================================================
#* Module Name:  hagsns
#*======================================================================


basecmd="hagsns"
basepath="/usr/sbin/rsct/bin"

SPMSG=${basepath}/hadspmsg
MSGMAPPATH=/usr/sbin/rsct/msgmaps
export MSGMAPPATH


# process the command lines
if [[ -z $1 ]]; then
   # no arguments
   $SPMSG hagsctrl ha_gs.cat IMsg_hagsns_Usage $basecmd $basecmd $basecmd $basecmd 
   exit
fi

args=""
c_opt=""
while getopts ":h:g:s:p:c" opt; do
    case $opt in
	h | s | p )
	    args="$args -${opt} $OPTARG" 
	    ;;
        g )
            opt=s
	    args="$args -${opt} $OPTARG" 
	    ;;
	c )
	    c_opt=1
	    ;;
	* )
	    #${basecmd}: Not a recognized flag: -${OPTARG}
            $SPMSG hagsctrl ha_gs.cat EMsg_Incorrect_Flag ${basecmd} ${OPTARG}
            $SPMSG hagsctrl ha_gs.cat IMsg_hagsns_Usage ${basecmd} ${basecmd} ${basecmd} ${basecmd}
	    exit 1
	    ;;
    esac
done

shift $(($OPTIND - 1))

if [[ ! -z $c_opt ]]; then
	# canonical form
	exec ${basepath}/${basecmd}_c $args
else
	# locale dependent
	exec ${basepath}/${basecmd}_nls $args
fi



