HIRS/package/scripts/common/db_drop.sh
2023-04-27 19:52:08 +00:00

21 lines
560 B
Bash

#!/bin/bash
# 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
# delete the database
if pgrep mysqld >/dev/null 2>&1; then
mysql -u "$user" --password="$pwd" < /opt/hirs/scripts/common/db_drop.sql
fi