mirror of
https://github.com/nsacyber/HIRS.git
synced 2025-02-21 10:01:49 +00:00
18 lines
475 B
Bash
18 lines
475 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')
|
|
|
|
# drop the database
|
|
if pgrep mysqld >/dev/null 2>&1; then
|
|
mysql -u "$user" --password="$pwd" < /opt/hirs/scripts/common/db_drop.sql
|
|
fi
|