mirror of
https://github.com/nsacyber/HIRS.git
synced 2024-12-21 13:57:56 +00:00
22 lines
402 B
Bash
22 lines
402 B
Bash
#!/bin/bash
|
|
|
|
PASS=$1
|
|
SCRIPT_DIR=$( dirname -- "$( readlink -f -- "$0"; )";)
|
|
|
|
if [ -d /opt/hirs/scripts/db ]; then
|
|
MYSQL_DIR="/opt/hirs/scripts/db"
|
|
else
|
|
MYSQL_DIR="$SCRIPT_DIR"
|
|
fi
|
|
|
|
echo "dropping hirs database"
|
|
|
|
|
|
if pgrep mysqld >/dev/null 2>&1; then
|
|
if [ -z ${PASS} ]; then
|
|
mysql -u "root" < $MYSQL_DIR/db_drop.sql
|
|
else
|
|
mysql -u "root" -p$PASS < $MYSQL_DIR/db_drop.sql
|
|
fi
|
|
fi
|