: $Workfile:   kixstart.sh  $ $Revision:   1.5  $
#**********************************************************************#
#*                                                                    *#
#* Copyright (c) 2001 by Sun Microsystems, Inc.                       *#
#* All rights reserved.                                               *#
#*                                                                    *#
#**********************************************************************#


# kixstart
# start system
# params: 4A:a:B:b:CcD:dFfG:h:I:i:Jj:KkL:l:M:N:no:O:P:p:Qq:R:rS:s:T:t:Uu:v:wx:X:YZ
#	Parameter 	Meaning
#	4		Use system semaphores instead of spin locks
#	A		single byte conversion table file - EBCDIC to ASCII
#	a		the format is a<char><num>
#			num - number of entries that can be added
#			char - p is for ppt table
#	B		Enable DBCS; double byte conversion table file - 
#			EBCDIC to ASCII
#	b		VSAM block size ( default = 4k)
#	C		Use COBOL version 1.2 or earlier
#	c		Same as C
#	D		Set debug options (-D t turns on internal trace)
#	d		Set general debug options
#	F		Start system in foreground
#	f		Redirect Logs to terminal that started system
#	G		A file containing RDO group names from DFHUSD file 
#	h		Hostname for socket listener
#	I		Percentage of index buffers allocated from total pool
#	i		Interval between stat checks, in seconds
#	J		writes 'kixjobreg <TERMID>' to job scripts
#	j		Spin count for NCR spin locks
#	K/k		Use Communications Manager (CommMgr)
#	L		Number of socket connections allowed for CICS Client
#	l		Local full path
#	Mc		set Maximum core size in bytes, K or M
#	Mt		set threshold size in bytes, K or M
#	N		Maximum number of trace dumps
#	n		ASKTIME/FORMATTIME format option; binary if set
#	o		Well known port for CORBA (IIOP) listener
#	O		Options:
#			         TDINTRA=[EMPTY|NOEMPTY]
#	P		Well known port for CICS Client server
#	p		Well known port for socket listener
#	Q		Use TERMQ instead of signals
#	q		Temp storage queue memory block size
#	R		Set Recovery Buffer Size, requires number from 0-n
#			    where 0 turns off recovery
#	r		Use machine-dependent format for system tables
#	S		Shared memory block size in bytes, K or M
#	s		Set port number for sockets to use
#	T		Force temporary storage to (M)ain or (A)uxiliary
#	t		Specify the name of an alternate Tran server
#	U		Undo Shared Memory splitting
#	u		Specify the name of an alternate Recov server
#	v		Specify the name of an alternate VSAM server
#	w		Window mode, only should be used on xwindow devices
#			    - must customize unikixani shell script to use
#	x		Set the pad size for extra area to be allocated at 
#			    end of shared memory blocks.
#	X		Well known port for ADMIN daemon
#	Y		Set to isolate System shared memory (detatch/reattach)
#	Z		Mapsets are not kept in shared storage after usage
#			Mapsets are read from disk on every usage

OPTIONS=""

set -- `getopt 4A:a:B:b:CcD:dFfG:h:I:i:Jj:KkL:l:M:N:no:O:P:p:Qq:R:rS:s:T:t:Uu:v:wx:X:YZ $*`

# default COBSW	for MicroFocus runtime system.
COBSW=${COBSW}-F
export COBSW

cd $KIXSYS

while test "$1" != "--"
do

    if test "$1" = "-4" 
    then
        OPTIONS="$OPTIONS -4"

    elif test "$1" = "-A"
    then
        shift
        OPTIONS="$OPTIONS -A $1"

    elif test "$1" = "-a"
    then
        shift
        OPTIONS="$OPTIONS -a $1"

    elif test "$1" = "-B" 
    then
	shift
        OPTIONS="$OPTIONS -B $1"
    
    elif test "$1" = "-b" 
    then
	shift
        OPTIONS="$OPTIONS -b $1"
    
    elif test "$1" = "-C" 
    then
        OPTIONS="$OPTIONS -C"
    
    elif test "$1" = "-c" 
    then
        OPTIONS="$OPTIONS -c"
    
    elif test "$1" = "-D"
    then
	shift
        OPTIONS="$OPTIONS -D $1"
    
    elif test "$1" = "-d" 
    then
        OPTIONS="$OPTIONS -d"
    
    elif test "$1" = "-F" 
    then
        OPTIONS="$OPTIONS -F"
    
    elif test "$1" = "-f" 
    then
        OPTIONS="$OPTIONS -f"

    elif test "$1" = "-G" 
    then
        shift
        OPTIONS="$OPTIONS -G $1"
    
    elif test "$1" = "-h" 
    then
        shift
        OPTIONS="$OPTIONS -h $1"
    
    elif test "$1" = "-I" 
    then
	shift
        OPTIONS="$OPTIONS -I $1"
    
    elif test "$1" = "-i" 
    then
	shift
        OPTIONS="$OPTIONS -i $1"
    
    elif test "$1" = "-J" 
    then
        OPTIONS="$OPTIONS -J"
    
    elif test "$1" = "-j" 
    then
	shift
        OPTIONS="$OPTIONS -j $1"
    
    elif test "$1" = "-K" 
    then
        OPTIONS="$OPTIONS -K"
    
    elif test "$1" = "-k" 
    then
        OPTIONS="$OPTIONS -k"
    
    elif test "$1" = "-L" 
    then
	shift
        OPTIONS="$OPTIONS -L $1"
    
    elif test "$1" = "-l" 
    then
	shift
        OPTIONS="$OPTIONS -l $1"
    
    elif test "$1" = "-M" 
    then
	shift
        OPTIONS="$OPTIONS -M $1"
    
    elif test "$1" = "-N" 
    then
	shift
        OPTIONS="$OPTIONS -N $1"
    
    elif test "$1" = "-n" 
    then
        OPTIONS="$OPTIONS -n"

    elif test "$1" = "-o"
    then
	shift
	OPTIONS="$OPTIONS -o $1"
    
    elif test "$1" = "-O"
    then
	shift
	OPTIONS="$OPTIONS -O $1"
    
    elif test "$1" = "-P" 
    then
	shift
        OPTIONS="$OPTIONS -P $1"
    
    elif test "$1" = "-p" 
    then
	shift
        OPTIONS="$OPTIONS -p $1"
    
    elif test "$1" = "-Q" 
    then
        OPTIONS="$OPTIONS -Q"
    
    elif test "$1" = "-q" 
    then
	shift
        OPTIONS="$OPTIONS -q $1"
    
    elif test "$1" = "-R" 
    then
	shift
        OPTIONS="$OPTIONS -R $1"
    
    elif test "$1" = "-r" 
    then
        OPTIONS="$OPTIONS -r"
    
    elif test "$1" = "-S" 
    then
	shift
        OPTIONS="$OPTIONS -S $1"
    
    elif test "$1" = "-s" 
    then
	shift
        OPTIONS="$OPTIONS -s $1"
    
    elif test "$1" = "-T" 
    then
	shift
        OPTIONS="$OPTIONS -T $1"
    
    elif test "$1" = "-t" 
    then
	shift
        OPTIONS="$OPTIONS -t $1"
    
    elif test "$1" = "-u" 
    then
	shift
        OPTIONS="$OPTIONS -u $1"
    
    elif test "$1" = "-U" 
    then
        OPTIONS="$OPTIONS -U"
    
    elif test "$1" = "-v" 
    then
	shift
        OPTIONS="$OPTIONS -v $1"
    
    elif test "$1" = "-w" 
    then
        OPTIONS="$OPTIONS -w"
    
    elif test "$1" = "-x" 
    then
	shift
        OPTIONS="$OPTIONS -x $1"

    elif test "$1" = "-X" 
    then
	shift
        OPTIONS="$OPTIONS -X $1"

    elif test "$1" = "-Y" 
    then
        OPTIONS="$OPTIONS -Y"
    
    elif test "$1" = "-Z"
    then
	OPTIONS="$OPTIONS -Z"

    else
	echo kixstart encountered an illegal option
        exit 1
        # illegal option encountered
    fi
    shift
done

# start	system
echo start unikixmain $OPTIONS
$UNIKIX/bin/unikixmain $OPTIONS

exit 0
