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


# kixstop
# terminate system
# params: F:f:Iik:L:l:M:m:P:p:S:s:Uu

OPTIONS=""
SHUTCOMMAND="cemt perform shutdown"

set -- `getopt F:f:Iik:L:l:M:m:P:p:S:s:Uu $*`

while test "$1" != "--"
do
    case $1 in
    -F|-f)
        shift
        OPTIONS="$OPTIONS -f $1"
        ;;
    -I|-i)
	SHUTCOMMAND="csmt shut,yes"
	;;
    -k)
        shift
        OPTIONS="$OPTIONS -k $1"
        ;;
    -L|-l)
        shift
        OPTIONS="$OPTIONS -l $1"
        ;;
    -M|-m)
        shift
        OPTIONS="$OPTIONS -m $1"
        ;;
    -P|-p)
        shift
        OPTIONS="$OPTIONS -p $1"
        ;;
    -S|-s)
        shift
        OPTIONS="$OPTIONS -s $1"
        ;;
    -U|-u)
        OPTIONS="$OPTIONS -u"
        ;;
    *)
        exit 1
        # illegal option encountered
        ;;
    esac
    shift
done

$UNIKIX/bin/unikixl -t"$SHUTCOMMAND" $OPTIONS
