HIRS/package/scripts/common/db_drop.sh

16 lines
427 B
Bash
Raw Normal View History

2023-01-19 17:13:46 -05:00
#!/bin/bash
2018-09-06 09:47:33 -04:00
2023-01-19 17:13:46 -05: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')
# drop the database
mysql -u "$user" --password="$pwd" < /opt/hirs/scripts/common/db_drop.sql