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 |
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 |
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 |