2023-04-27 19:51:22 +00:00
|
|
|
#!/bin/bash
|
2018-09-06 09:47:33 -04:00
|
|
|
|
2023-04-27 19:51:22 +00:00
|
|
|
# Get the current password from the perstence.properties file
|
|
|
|
#file="/etc/hirs/persistence.properties"
|
|
|
|
# Change java key/value pairs into valid bash key/value pairs
|
|
|
|
#function prop {
|
|
|
|
# grep "${1}" ${file} | cut -d'=' -f2 | xargs
|
|
|
|
#}
|
|
|
|
|
|
|
|
#user="root"
|
|
|
|
# user=$(prop 'persistence.db.user')
|
|
|
|
#pwd=$(prop 'persistence.db.password')
|
|
|
|
pwd="root"
|
|
|
|
|
|
|
|
# Need to update when password get written to the persitence fil
|
2018-09-06 09:47:33 -04:00
|
|
|
# delete the database
|
2023-04-27 19:51:22 +00:00
|
|
|
|
|
|
|
if pgrep mysqld >/dev/null 2>&1; then
|
|
|
|
mysql -u "$user" --password="$pwd" < /opt/hirs/scripts/common/db_drop.sql
|
|
|
|
fi
|