Hi...
I slightly modified Bhaskar's script
it is below.
It does some other things to....like gde, mupip, rundown

I don't know which commands don't need the environment so I put it in
all of them.

ALSO.... 

Bhaskar, since this is your script... would you mind horribley GPL'ing
it?

MORE IMPORTANTLY,
I hope you don't mind the hash I made of your script.

-----------------------------------------------------------------------------------------

#!/bin/bash
# Install and run OpenVistA for the OpenVistA Vivum live CD.
# GT.M[TM] is assumed to be on the CD at /usr/local/gtm.
# OpenVistA distribution is assumed to be on the CD
at /usr/local/OpenVistA.
#
# This script is placed in the public domain by K.S. Bhaskar
#
# For demonstration purposes only, and not for production use.
# The user assumes all responsibility for using this script.
#
# Revision history
# 20040103  0.1   K.S. Bhaskar    Initial Creation
# 20040119  0.11  K.S. Bhaskar    Make mount command sudo
# 20040122  0.12  K.S. Bhaskar    Remove mount command and require
directories be mounted in advance
# 20040605  0.2   K.S. Bhaskar    Put all source files in one directory
# 20050404  0.201 Manolis.        Modified script slightly for no
Xdialog boxes and added commands.

# Default locations for GT.M and OpenVistA
if [[ -z $gtm_source ]] ; then export gtm_source=/usr/local/gtm ; fi
if [[ -z $vista_source ]] ; then export
vista_source=/usr/local/OpenVistA ; fi

# Set up GT.M environment & point to global directory
. $gtm_source/gtmprofile
export gtmgbldir=$vista_source/g/mumps.gld

echo
echo "The no Xdialog version of Bhaskar's script"
echo

# Determine action
case $1 in
  --install) action="Install (and run)" ;;
  --run) action="Run" ;;
  --erase) action="Erase" ;;
  --rundown) action="Rundown" ;;
  --gde) action="gde";;
  --lke) action="lke";;
  --dse) action="dse";;
  --mupip) action="mupip";;
  *) echo "vista usage "
     echo "vista --install <directory>     install (and run)"
     echo "vista --run <directory>         run vista"
     echo "vista --erase <directory>       delete vista"
     echo "vista --rundown <directory>     rundown vista"
     echo "vista --gde <directory>         system management utility"
     echo "vista --lke <directory>         lock contention utility"
     echo "vista --dse <directory>         system management utility"
     echo "vista --mupip <directory>       system mamagement for startup
and shutdown"
     exit 1;;
esac


  # Determine directory if none specified
  if [[ -z $2  ]]
    then echo "must be called specifying the directory ... vista
--<action> <directory>" ; exit 1
  else export vista_home=$2
  fi


# For Run and Erase directory must exist; for Install OK to create if
non existent
case $action in
  ("Run"|"Erase") if ! [[ -f $vista_home/g/mumps.dat ]]
      then echo "$vista_home/g/mumps.dat does not exist.  Exiting..." ;
exit 1
      fi ;;
  *)  if ! [[ -d $vista_home && -d $vista_home/o && -d $vista_home/r ]]
      then echo "$vista_home and/or subdirectories don't exist.
creatingi them now!"
        if ! `mkdirhier $vista_home/g $vista_home/o $vista_home/r`
        then echo "Unable to create $vista_home and/or subdirectories.
Exiting..."; exit 1
        fi
      fi ;;
esac

export gtmroutines="$vista_home/o($vista_home/r)
$vista_source/o($vista_source/r) $gtm_dist"
echo "----- Environment ----------------------------"
echo "vista_home    = $vista_home"
echo "gtmroutines   = $gtmroutines"
echo "gtmgbldir     = $gtmgbldir"
echo "gtm_source    = $gtm_source"
echo "vista_source  = $vista_source"
echo "----------------------------------------------"
echo


case $action in
  "Run")
    cd $vista_home
    if [[ -z $3 ]] ; then $gtm_dist/mumps -dir ; else $gtm_dist/mumps
-run $3 ; fi
  ;;
  "Erase") if ! `rm -rf $vista_home`
    then echo "Unable to delete $vista_home.  Exiting..." ; exit 1
    fi
  ;;
  "Install (and run)") echo "Copying the database.  May take several
minutes."
    gzip -d <$vista_source/g/mumps.dat.gz >$vista_home/g/mumps.dat
    if [[ -z $3 ]] ; then $gtm_dist/mumps -dir ; else $gtm_dist/mumps
-run $3 ; fi
;;
  "Rundown")
        echo "Running Down"
        $gtm_dist/mupip rundown -r "*"
        ;;
  "gde")
        $gtm_dist/mumps -r ^GDE
        ;;
  "dse")
        $gtm_dist/dse
        ;;
  "lke")
        $gtm_dist/lke
        ;;
  "mupip")
       $gtm_dist/mupip
       ;;
esac




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Hardhats-members mailing list
Hardhats-members@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hardhats-members

Reply via email to