solinit [SRC] [CPP] [JOB] [SCAN]
TOOLS / SCRIPTS



   1 | #!/bin/sh
   2 | 
   3 | echo " SOLINIT v1.0"
   4 | echo " Description : tool to create an initial solution for PRISSMA"
   5 | 
   6 | #
   7 | # Path definitions
   8 | #
   9 | 
  10 | LOCALDIR=`pwd`
  11 | CHOICESD=$DOMHOME/TOOLS/CHOICES
  12 | PERSODIR=$DOMHOME/TOOLS/INCLUDE
  13 | TOOLDIR=$DOMHOME/TOOLS/SOLINIT
  14 | 
  15 | #
  16 | # Detect if all files are ready for run
  17 | #
  18 | 
  19 | ECHOICES=0
  20 | EPERSO=0
  21 | DORUN=1
  22 | 
  23 | if [ -f 'solinit.choices' ]
  24 | then
  25 |   ECHOICES=1
  26 | fi
  27 | 
  28 | if [ -f 'perso.inc' ]
  29 | then
  30 |   EPERSO=1
  31 | fi
  32 | 
  33 | if [ $ECHOICES -eq 1 ]
  34 | then
  35 |   echo " Choices file found"
  36 | else
  37 |   cp $CHOICESD/solinit.choices .
  38 |   echo " -- No solinit.choices file found, copying default file."
  39 |   echo "    Fill the choices file and run again solinit"
  40 |   DORUN=0
  41 | fi
  42 | 
  43 | if [ $EPERSO -eq 1 ]
  44 | then
  45 |   echo " perso.inc profile found"
  46 | else
  47 |   cp $PERSODIR/perso.inc ./perso.inc
  48 |   echo " -- No perso.inc file found, copying default file."
  49 |   echo "    Fill in the desired profile and run again solinit"
  50 |   DORUN=0
  51 | fi
  52 | 
  53 | if [ $DORUN -eq 1 ]
  54 | then
  55 |   cp ./perso.inc ./perso.inc_bup
  56 |   cp $PERSODIR/perso.inc $PERSODIR/perso.inc_old
  57 |   cp ./perso.inc $PERSODIR/perso.inc_new
  58 |   cp ./perso.inc $PERSODIR/perso.inc
  59 | 
  60 |   make -f $TOOLDIR/Makefile all
  61 |   mv ./perso.inc_bup ./perso.inc
  62 |   $DOMHOME/HOSTS/$DOM_HOSTTYPE/solinit_$DOM_VERSION.e_$DOM_HOSTTYPE
  63 | fi