/[PAMELA software]/YodaProfiler/docs/install_DB.sh
ViewVC logotype

Diff of /YodaProfiler/docs/install_DB.sh

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.5 by mocchiut, Tue Nov 7 12:17:44 2006 UTC revision 1.6 by mocchiut, Thu Sep 6 07:39:13 2007 UTC
# Line 4  USERNAME=${PAM_DBUSER} Line 4  USERNAME=${PAM_DBUSER}
4  HOST=""  HOST=""
5  DBNAME=""  DBNAME=""
6  FORCE="no"  FORCE="no"
7    GPAMELA="no"
8  COUNT=0;for word in `echo ${PAM_DBHOST} | tr [\/] [" "] |tr [?] [" "] |sed 's/mysql://g' `; do if [ $COUNT -eq 0 ]; then HOST=`echo $word`; fi; if [ $COUNT -eq 1 ]; then DBNAME=`echo $word`; fi; let COUNT=$COUNT+1; done  COUNT=0;for word in `echo ${PAM_DBHOST} | tr [\/] [" "] |tr [?] [" "] |sed 's/mysql://g' `; do if [ $COUNT -eq 0 ]; then HOST=`echo $word`; fi; if [ $COUNT -eq 1 ]; then DBNAME=`echo $word`; fi; let COUNT=$COUNT+1; done
9  PASSWORD=${PAM_DBPSW}  PASSWORD=${PAM_DBPSW}
10  if [ $# -gt 0 ]; then  if [ $# -gt 0 ]; then
# Line 44  if [ $# -gt 0 ]; then Line 45  if [ $# -gt 0 ]; then
45              FORCE="yes";              FORCE="yes";
46              export FORCE;              export FORCE;
47          fi          fi
48            if [ "$INPUT" == "--gpamela" ]; then
49                GPAMELA="yes";
50                export GPAMELA;
51            fi
52      done      done
53  else  else
54      if [ "$USERNAME" == "" ] || [ "$HOST" == "" ] || [ "$DBNAME" == "" ]; then      if [ "$USERNAME" == "" ] || [ "$HOST" == "" ] || [ "$DBNAME" == "" ]; then
# Line 77  rm -rf ${THISDIR}/temp.sql Line 82  rm -rf ${THISDIR}/temp.sql
82  cat ${THISDIR}/PAMELAProductionDB.sql | sed 's/dbname/'${DBNAME}'/g' >> ${THISDIR}/temp.sql  cat ${THISDIR}/PAMELAProductionDB.sql | sed 's/dbname/'${DBNAME}'/g' >> ${THISDIR}/temp.sql
83  mysql --user=$USERNAME --password=$PASSWORD --host=$HOST < ${THISDIR}/temp.sql  mysql --user=$USERNAME --password=$PASSWORD --host=$HOST < ${THISDIR}/temp.sql
84  echo " done! "  echo " done! "
85    #
86    #
87    #
88    if [ "$GPAMELA" == "yes" ]; then
89        echo ""
90        echo " Adapting GL_PARAM table to be used with simulated data "
91        echo ""
92    #
93        rm -rf ${THISDIR}/temp.sql
94    #
95        cat ${THISDIR}/GP_PARAM.sql | sed 's/dbname/'${DBNAME}'/g' >> ${THISDIR}/temp.sql
96        mysql --user=$USERNAME --password=$PASSWORD --host=$HOST < ${THISDIR}/temp.sql
97    #
98        echo " done! "
99    fi;
100    #
101  echo ""  echo ""
102  rm -rf ${THISDIR}/temp.sql  rm -rf ${THISDIR}/temp.sql

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

  ViewVC Help
Powered by ViewVC 1.1.23