#!/bin/sh # Hey EMACS, this should be in -*- ksh -*- mode # # FILE: install-dome # AUTHOR: Tom Peterson (tap@htc.honeywell.com) # OVERVIEW: Simple script for installing DOME on any UN*X platform # USE: install-dome [-config] # # COPYRIGHT # Copyright (C) 1993-1996 Honeywell Technology Center # All Rights Reserved. # No unauthorized duplication or distribution allowed. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # See your DOME License for more details. # # HISTORY # [tap:19970401.0832CST] Created # what am I called? PROGNAME=`basename $0` usage() { echo "Usage: $PROGNAME [-i]" 1>&2; exit 1;} # return a canonical name for a directory passed canonicalize() { (cd $1; pwd); } interactive=FALSE # Parse arguments while true; do case $1 in -i ) interactive=TRUE;shift;; "" ) break ;; * ) usage ;; esac done # force 'canonicalized version of DOMEROOT for prompt DOMEROOT=`canonicalize \`dirname $0\`/..` if [ "$interactive" = TRUE ]; then cat << EOH This will customize the DOME Installation to work wherever you have installed the DOME software. Several questions may be asked; please respond by entering the appropriate response or accept the default in brackets by simply pressing return. EOH # read the appropriate DOMEROOT Directory echo "" echo "What directory does THIS version of DOME reside in?" echo "This may be a NFS mountable directory." echo "[$DOMEROOT] : " read new_root new_root=${new_root:-$DOMEROOT} else new_root=$DOMEROOT fi # Fix the DOMEROOT variable in $dome_file dome_file=$new_root/bin/dome if [ "$interactive" = TRUE ]; then echo "" echo "Fixing dome script: $dome_file" fi chmod u+w `dirname $dome_file` $dome_file tmpFile=/tmp/install.dome.$$ if [ -f "${dome_file}.orig" ]; then cp -p $dome_file.orig $dome_file fi sed "s:^\(DOMEROOT=\${DOMEROOT\:-\"\)/usr/local/dome\"}:\1$new_root\"}:" <$dome_file >$tmpFile if [ ! -f "${dome_file}.orig" ]; then cp -p $dome_file $dome_file.orig fi cat $tmpFile > $dome_file /bin/rm -f $tmpFile