#
# ident "@(#)bbutdev.src	1.4 05/02/17 SMI"
#
# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.
#

. $BBROOT/etc/opt/SUNWbb/blackbox.rc

KIOSK_CONF=/var/opt/SUNWut/kiosk/kiosk.conf

case "$1" in

'start')
	if [ ! -f $KIOSK_CONF ]; then
		exit 0
	fi
	grep $BBROOTPATH/tmp/SUNWut/sessions /etc/mnttab > /dev/null 2>&1 
	if [ $? != 0 ]; then
		mkdir -p $BBROOTPATH/tmp/SUNWut/sessions > /dev/null 2>&1
		mkdir -p /tmp/SUNWut/sessions > /dev/null 2>&1
                /sbin/mount -F lofs /tmp/SUNWut/sessions \
			$BBROOTPATH/tmp/SUNWut/sessions
	fi
	grep $BBROOTPATH/tmp/SUNWut/units /etc/mnttab > /dev/null 2>&1
        if [ $? != 0 ]; then
		mkdir -p $BBROOTPATH/tmp/SUNWut/units > /dev/null 2>&1
		mkdir -p /tmp/SUNWut/units > /dev/null 2>&1
                /sbin/mount -F lofs /tmp/SUNWut/units \
			$BBROOTPATH/tmp/SUNWut/units
	fi
	;;

'stop') 
        grep $BBROOTPATH/tmp/SUNWut/sessions /etc/mnttab > /dev/null 2>&1
        if [ $? = 0 ]; then
                /sbin/umount $BBROOTPATH/tmp/SUNWut/sessions
        fi
        grep $BBROOTPATH/tmp/SUNWut/units /etc/mnttab > /dev/null 2>&1
        if [ $? = 0 ]; then
                /sbin/umount $BBROOTPATH/tmp/SUNWut/units
        fi 
	;;
*)
        echo "Usage: $0 { start | stop }"
        exit 1
        ;;

esac       

