mirror of
https://github.com/nsacyber/HIRS.git
synced 2025-01-22 04:18:20 +00:00
updated bd_create for rel8
This commit is contained in:
parent
0bf5d36c0a
commit
ac8218b634
@ -10,31 +10,25 @@ fi
|
||||
echo "Creating HIRS Database..."
|
||||
|
||||
if [ $DOCKER_CONTAINER = true ]; then
|
||||
echo "running in a container..."
|
||||
# If in Docker container, avoid services that invoke the D-Bus
|
||||
if [[ $(pgrep -c -u mysql mysqld) -eq 0 ]]; then
|
||||
/usr/libexec/mariadb-prepare-db-dir
|
||||
nohup /usr/bin/mysqld_safe --basedir=/usr &>/dev/null &
|
||||
MYSQLD_PID=$(pgrep -u mysql mysqld)
|
||||
/usr/libexec/mariadb-wait-ready $MYSQLD_PID
|
||||
fi
|
||||
# if [[ $(pgrep -c -u mysql mysqld) -eq 0 ]]; then
|
||||
# /usr/libexec/mariadb-prepare-db-dir
|
||||
# nohup /usr/bin/mysqld_safe --basedir=/usr &>/dev/null &
|
||||
# MYSQLD_PID=$(pgrep -u mysql mysqld)
|
||||
# /usr/libexec/mariadb-wait-:ready $MYSQLD_PID
|
||||
# fi
|
||||
else
|
||||
SQL_SERVICE=`/opt/hirs/scripts/common/get_db_service.sh`
|
||||
chkconfig $SQL_SERVICE on
|
||||
service $SQL_SERVICE start
|
||||
systemctl $SQL_SERVICE enable
|
||||
systemctl $SQL_SERVICE start
|
||||
fi
|
||||
|
||||
if [[ -f /etc/redhat-release ]] ; then
|
||||
CENTOS_VER=`/opt/hirs/scripts/common/get_centos_major_version.sh`
|
||||
elif [[ -f /etc/os-release ]] ; then
|
||||
AMAZON_VER=`/opt/hirs/scripts/common/get_amazon_linux_major_version.sh`
|
||||
fi
|
||||
if [ $CENTOS_VER -eq "6" ] ; then
|
||||
DB_CREATE_SCRIPT=/opt/hirs/scripts/common/db_create.sql.el6
|
||||
elif [ $CENTOS_VER -eq "7" ] || [ $AMAZON_VER -eq "2" ] ; then
|
||||
DB_CREATE_SCRIPT=/opt/hirs/scripts/common/db_create.sql.el7
|
||||
else
|
||||
echo "Unsupported Linux detected"
|
||||
exit 1
|
||||
fi
|
||||
DB_CREATE_SCRIPT=/opt/hirs/scripts/common/db_create.sql.el7
|
||||
|
||||
mysql -u root --password="hirs_db" < $DB_CREATE_SCRIPT
|
||||
|
||||
// Set logfile for
|
||||
echo '[mysqld]' >> /etc/my.cnf
|
||||
echo 'log-error=/var/log/mariadb/hirs_db.log' >> /etc/my.cnf
|
||||
|
||||
mysql -u root < $DB_CREATE_SCRIPT
|
||||
|
@ -1,5 +1,10 @@
|
||||
#!/bin/bash
|
||||
tom_version="10.1.1"
|
||||
CATALINA_HOME=/opt/tomcat/
|
||||
CATALINA_BASE=/opt/tomcat/
|
||||
|
||||
export CATALINA_HOME
|
||||
export CATALINA_BASE
|
||||
|
||||
# Check if tomcat already installed
|
||||
if [ -d "/opt/tomcat" ]; then
|
||||
|
Loading…
Reference in New Issue
Block a user