4 |
HOST="" |
HOST="" |
5 |
DBNAME="" |
DBNAME="" |
6 |
FORCE="no" |
FORCE="no" |
7 |
|
STATIC="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 |
21 |
echo "" |
echo "" |
22 |
echo " --psw=password : MySQL password" |
echo " --psw=password : MySQL password" |
23 |
echo "" |
echo "" |
24 |
echo " --force : do not wait [default: wait]" |
echo " --force : do not wait [default: wait]" |
25 |
|
echo "" |
26 |
|
echo " --static : use static path instead of symbolic ones ($PAM_CALIB) [default: no]" |
27 |
echo "" |
echo "" |
28 |
exit 0 |
exit 0 |
29 |
fi |
fi |
47 |
FORCE="yes"; |
FORCE="yes"; |
48 |
export FORCE; |
export FORCE; |
49 |
fi |
fi |
50 |
|
if [ "$INPUT" == "--static" ]; then |
51 |
|
STATIC="yes"; |
52 |
|
export STATIC; |
53 |
|
fi |
54 |
done |
done |
55 |
else |
else |
56 |
if [ "$USERNAME" == "" ] || [ "$HOST" == "" ] || [ "$DBNAME" == "" ]; then |
if [ "$USERNAME" == "" ] || [ "$HOST" == "" ] || [ "$DBNAME" == "" ]; then |
86 |
echo "delete from GL_PARAM;" > ${THISDIR}/temp.sql |
echo "delete from GL_PARAM;" > ${THISDIR}/temp.sql |
87 |
mysql --user=$USERNAME --password=$PASSWORD --host=$HOST $DBNAME < ${THISDIR}/temp.sql |
mysql --user=$USERNAME --password=$PASSWORD --host=$HOST $DBNAME < ${THISDIR}/temp.sql |
88 |
# |
# |
89 |
cat ${THISDIR}/install_GL_PARAM.sql | sed 's/fullpathgoesere/'${PAM_CALIB2}'/g' >> ${THISDIR}/temp.sql |
if [ "$STATIC" == "no" ]; then |
90 |
|
cat ${THISDIR}/install_GL_PARAM.sql | sed 's/fullpathgoesere/$PAM_CALIB/g' >> ${THISDIR}/temp.sql |
91 |
|
else |
92 |
|
cat ${THISDIR}/install_GL_PARAM.sql | sed 's/fullpathgoesere/'${PAM_CALIB2}'/g' >> ${THISDIR}/temp.sql |
93 |
|
fi; |
94 |
mysql --user=$USERNAME --password=$PASSWORD --host=$HOST $DBNAME < ${THISDIR}/temp.sql |
mysql --user=$USERNAME --password=$PASSWORD --host=$HOST $DBNAME < ${THISDIR}/temp.sql |
95 |
# |
# |
96 |
echo " done! " |
echo " done! " |