#!/usr/bin/sh

#  Copyright(c) 2002 Sun Microsystems, Inc.
#  All rights reserved.

#pragma^Iident^I"@(#)ScHeDuLeMaNaGeR^I1.1^I02/09/11 SMI"

# This script is for Scheudle Manager RFE 4705995
# It is invoked from crontab

VTS_BIN=`/usr/bin/dirname $0`

ps -e | grep vtsk

	if [ $? -gt 0 ];
	   then
		if [ `isainfo -v | wc -l` -eq 1 ]
			then 
        			`$VTS_BIN/vtsk`	# run 32 bit vtsk
		elif [ `isainfo -v | wc -l` -eq 2 ]
			then
				`$VTS_BIN/sparcv9/vtsk` # run 64 bit vtsk
		else 
			exit 0
		fi


	        if [ $? -eq 0 ];
        	then
                	sleep 1
        	else
                	exit 0
        	fi
	fi

        $VTS_BIN/vts_cmd "reg_sched $1 $2 $3 $4 $5"
	# register the schedule with kernel with all parameters
	# $1 = start_option
	# $2 = switch "-s or -o"
	# $3 = test_mode or option file
	# $4 = duration in min
	# $5 = schedule name
