Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [root@staging-linux03 ~]# cat testsolr.sh
- #!/bin/bash
- . /etc/init.d/cr-env
- # solr
- dbuser=`grep -m 1 user-name /var/lib/jboss/server/web/deploy/CR_${crEnv}-ds.xml | sed -e 's/^[ \t]*//' -e 's/<user-name>//' -e 's/<\/user-name>//'`
- dbpass=`grep -m 1 password /var/lib/jboss/server/web/deploy/CR_${crEnv}-ds.xml | sed -e 's/^[ \t]*//' -e 's/<password>//' -e 's/<\/password>//'`
- dbhost=`grep -m 1 'connection-url' /var/lib/jboss/server/web/deploy/CR_${crEnv}-ds.xml | sed -e 's/^[ \t]*//' -e 's|<connection-url>jdbc\:mysql\://||' -e 's|\:.*$||'`
- dbport=`grep -m 1 'connection-url' /var/lib/jboss/server/web/deploy/CR_${crEnv}-ds.xml | sed -e 's/^[ \t]*//' -e 's|<connection-url>jdbc\:mysql\://||' -e 's|^.*\:||' -e 's|/.*$||'`
- dbname=`grep -m 1 'connection-url' /var/lib/jboss/server/web/deploy/CR_${crEnv}-ds.xml | sed -e 's/^[ \t]*//' -e 's|<connection-url>jdbc\:mysql\://||' -e 's|^.*[0-9][0-9][0-9][0-9]/||' -e 's|<.*$||'`
- echo "lf"
- cmd="mtest -u ${dbuser} -p ${dbpass} -h ${dbhost} -P ${dbport} ${dbname}"
- # -se "select max(CustomerID) from tbl_Customer"
- echo "command: $cmd"
- #maxcust=`$cmd | grep -v CustomerID`
- dbpass="testpass"
- dbhost="testhost"
- dbname="testname"
- dbport="3306"
- echo "dbuser: $dbuser"
- echo "dbpass: $dbpass"
- echo "dbhost: $dbhost"
- echo "dbport: $dbport"
- echo "dbname: $dbname"
- echo "db cmd: mysql -u${dbuser} -p${dbpass} -h ${dbhost} -P ${dbport} ${dbname} -se \"select max(CustomerID) from tbl_Customer\" | grep -v CustomerID"
- echo "maxcust: $maxcust"
- [root@staging-linux03 ~]# ./testsolr.sh
- lf
- -h localhost -P 3306 chrome_expense_staging1
- dbuser: chrome
- dbpass: testpass
- dbhost: testhost
- dbport: 3306
- dbname: testname
- -ptestpass -h testhost -P 3306 testname -se "select max(CustomerID) from tbl_Customer" | grep -v CustomerID
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement