#!/bin/csh -f
#*****************************************************************************
#                                                                            *
#            Copyright (C) 1993, Alias Research, Inc.                        *
#                                                                            *
#    These coded instructions,  statements and  computer programs contain    *
#    unpublished information proprietary to Alias Research, Inc.  and are    *
#    protected by the Canadian and US Federal copyright law. They may not    *
#    be disclosed to third parties  or copied  or duplicated, in whole or    *
#    in part,  without the prior written consent of Alias Research,  Inc.    *
#                                                                            *
# Unpublished-rights reserved under the Copyright Laws of the United States. *
#                                                                            *
#****************************************************************************/
#
#       $Source: /tmp_mnt/repo/root/v/alias3.2.2/src/Gifts/bin/RCS/drender_driver.csh.sgi,v $
#       $Author: psantan $ $Date: 93/06/23 16:05:31 $
#
#

if (! $?ALIAS_LOCATION ) then
    echo "ALIAS_LOCATION environment variable must be set to install drender"
    exit -1
else
    set NT_DR=${ALIAS_WORKENV}/user_data/demo/misc_data/drender.pst
    set NT_RUNNING="1"

    while ( "${NT_RUNNING}" == "1" ) 
        pst ${NT_DR}
        if ( $status == "1" ) then
            exit 1
        endif

        set NT_COMMAND="`pstget ${NT_DR} '*.command' 'Submit Jobs'`"
        setenv NT_MASTER_DIR "`pstget ${NT_DR} '*.control' '' `"

        if ( "${NT_MASTER_DIR}" == "" ) then

            aliasWarning -s "Master directory must be set prior to"     \
                         -s "use of any drender commands" -b"Ok"

        else if (! -d "${NT_MASTER_DIR}" ) then

            aliasWarning -s "Master directory must exist prior to"      \
                         -s "use of any drender commands" -b"Ok"
        endif 

        switch ( "${NT_COMMAND}" )
            case "Quit":
                exit 0
                breaksw

            case "Check Network":
                drender_health
                breaksw

            case "Start Machine":
                drender_unlock
                breaksw

            case "Stop Machine":
                drender_lock
                breaksw

            case "Submit Jobs":
                drender_submit
                breaksw

            case "List Jobs":
                drender_list 
                breaksw

            case "Delete Jobs":
                drender_delete
                breaksw

            case "Delete Logs":
                drender_dellogs
                breaksw

            case "List Log Files":
                drender_log
                breaksw

            case "Setup Machine":
                drender_install
                breaksw

            case "Remove Machine":
                drender_kill
                breaksw
        endsw
    end
endif






