
:
#  	
#     Copyright (c) 1989             The Santa Cruz Operation, Inc. 
#  								     
#     All rights reserved. No part of this program or publication may
#     be reproduced, transmitted, transcribed, stored in a retrieval
#     system, or translated into any language or computer language,
#     in any form or by any means, electronic, mechanical, magnetic, 
#     optical, chemical, biological, or otherwise, without the prior 
#     written permission of:    			            
#  								   
#             The Santa Cruz Operation, Inc      (408) 425-7222   
#             400 Encinal St., Santa Cruz, California 95061 USA    
#  								  
#


CLASS=ScoSession
SCO_DEFAULTS="/usr/lib/X11/sco/startup"
ODTPREF_DIR="$HOME/.odtpref"
CONFIG_DIR="$ODTPREF_DIR/$CLASS"
PATH="/usr/bin/X11:$PATH"
XRDBSTART=$DISPLAY
XRDBSAVE=xrdb.save
XDEFAULTS="$HOME/.Xdefaults"
XDEFAULTS_HOST="$HOME/.Xdefaults-`uname -s`"

export CLASS SCO_DEFAULTS ODTPREF_DIR CONFIG_DIR PATH XRDBSTART XRDBSAVE



#
#  Set up user's initial xrdb settings.
#

InitXrdb ()
{

    if [ -d $SCO_DEFAULTS ]
    then
        rm -f /tmp/tmp$$
        for i in $SCO_DEFAULTS/*
        do
            cat $i >> /tmp/tmp$$
        done
	xrdb -merge /tmp/tmp$$
        rm -f /tmp/tmp$$
    fi

    rm -f $CONFIG_DIR/$XRDBSTART
    xrdb -query > $CONFIG_DIR/$XRDBSTART

    if [ -f $CONFIG_DIR/$XRDBSAVE ]
    then
	xrdb -merge $CONFIG_DIR/$XRDBSAVE
    fi

    if [ -f $XDEFAULTS ] && [ ! -f $XDEFAULTS_HOST ]
    then
	ln $XDEFAULTS $XDEFAULTS_HOST
    fi

}



#
#  Execute all executables in ODTPREF_DIR
#

InitConfig ()
{
     
     for i in $ODTPREF_DIR/*
     do
	 [ -x $i ] && [ -f $i ] && $i
     done

}







#
#   main
#


[ -d $CONFIG_DIR ] || mkdir -p $CONFIG_DIR
InitXrdb 
InitConfig
exit 0
