| 1 | #! /bin/bash |
| 2 | # .COPYRIGHT: Copyright (c) 2002-2011 European Southern Observatory, |
| 3 | # all rights reserved |
| 4 | # .TYPE command |
| 5 | # .NAME autoinstall |
| 6 | # .LANGUAGE shell script |
| 7 | # .ENVIRONMENT Unix Systems. Executable under SHELL and C-SHELL |
| 8 | # .COMMENTS Automatic installation procedure of MIDAS |
| 9 | # Usage: autoconfig |
| 10 | # |
| 11 | # .REMARKS The external variable $MIDASHOME and $MIDVERS must be set |
| 12 | # |
| 13 | # .AUTHOR Carlos Guirao |
| 14 | # .VERSION |
| 15 | # 021028 implementation |
| 16 | # 111206 last modif |
| 17 | # |
| 18 | # Checks echo command which option to use to get NO NEW LINE |
| 19 | # |
| 20 | echo=echo |
| 21 | if [ "`echo -n `" = "-n" ] ; then |
| 22 | SV_NONL="\c" |
| 23 | else |
| 24 | echo="echo -n" |
| 25 | fi |
| 26 | |
| 27 | clear |
| 28 | |
| 29 | cd `echo $0 | sed -e 's/[^\/]*$//' -e 's/^$/./' -e 's/\/$//'` |
| 30 | MID_INSTALL=`pwd` |
| 31 | VERSDIR=`echo $MID_INSTALL | sed 's/\/install\/unix$//'` |
| 32 | MIDVERS=`echo $VERSDIR | sed -e 's/^.*\///'` |
| 33 | MIDASHOME=`echo $VERSDIR | sed -e 's/[^\/]*$//' -e 's/^$/./' -e 's/\/$//'` |
| 34 | |
| 35 | MID_INSTALL=$MIDASHOME/$MIDVERS/install/unix |
| 36 | MID_HOME=$MIDASHOME/$MIDVERS |
| 37 | |
| 38 | export MIDASHOME MIDVERS |
| 39 | |
| 40 | # |
| 41 | # CG: The DISPLAY variable is not needed anymore. I'm using 'ascii_bin no' |
| 42 | #if [ -z "$DISPLAY" ]; then |
| 43 | # echo "DISPLAY environment variable not set - exiting" |
| 44 | # exit 1 |
| 45 | #fi |
| 46 | |
| 47 | # |
| 48 | # START |
| 49 | # |
| 50 | echo "**********************************************************************" |
| 51 | echo "********** MIDAS AUTO INSTALLATION/CONFIGURATION SCRIPT **************" |
| 52 | echo "**********************************************************************" |
| 53 | echo "********** MIDASHOME: $MIDASHOME" |
| 54 | echo "********** MIDVERS: $MIDVERS" |
| 55 | echo "" |
| 56 | |
| 57 | $echo "Do you want to continue [yn]? (y): " $SV_NONL |
| 58 | read answ |
| 59 | if [ -z "$answ" ]; then |
| 60 | answ="y" |
| 61 | fi |
| 62 | if [ "$answ" = "n" -o "$answ" = "N" ]; then |
| 63 | exit 1 |
| 64 | fi |
| 65 | |
| 66 | /bin/bash $MID_INSTALL/select all |
| 67 | /bin/bash $MID_INSTALL/preinstall -a |
| 68 | /bin/bash $MID_INSTALL/install1 -a |
| 69 | /bin/bash $MID_INSTALL/setup -a |
| 70 | /bin/bash ../../system/unix/inmidas -j "@ compile.all" |
| 71 | /bin/bash ../../system/unix/inmidas -j "@ ascii_bin no ; bye" |
| 72 | |
| 73 | echo " " |
| 74 | echo "**********************************************************************" |
| 75 | echo "Midas installation successfully terminated." |
| 76 | echo "on: "`date` |
| 77 | echo " " |
| 78 | echo "Enter:" |
| 79 | echo " inmidas (if you want to run MIDAS defaults)" |
| 80 | echo " gomidas (to restart the previous MIDAS session)" |
| 81 | echo " helpmidas (standalone GUI help for MIDAS)" |
| 82 | echo " drs <midas_command> (execute MIDAS command from Unix command line)" |
| 83 | echo "**********************************************************************" |
| 84 | |
| 85 | exit 0 |