mirror of
https://github.com/nsacyber/HIRS.git
synced 2024-12-21 13:57:56 +00:00
Merge pull request #602 from nsacyber/v3_issue_599
Added check for existing aca.properties in the ACA setup files
This commit is contained in:
commit
04381985ee
@ -41,7 +41,18 @@ source $SCRIPT_DIR/mysql_util.sh
|
||||
source $ACA_PROP_FILE
|
||||
|
||||
check_mysql_root_pwd () {
|
||||
# Check if DB root password needs to be obtained
|
||||
|
||||
# Check if DB root password needs to be obtained via env variable or existing property file
|
||||
if [ -z "$HIRS_MYSQL_ROOT_PWD" ]; then
|
||||
# Check if property file exists and look for properties
|
||||
if [ -f $ACA_PROP_FILE ]; then
|
||||
echo "Found existing aca.properties, using existing variables..."
|
||||
source $ACA_PROP_FILE
|
||||
if [ ! -z $hirs_pki_password ]; then PKI_PASS=$hirs_pki_password; fi
|
||||
if [ ! -z $mysql_admin_password ]; then HIRS_MYSQL_ROOT_PWD=$mysql_admin_password; fi
|
||||
if [ ! -z $hirs_db_password ]; then HIRS_DB_PWD=$hirs_db_password; fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -z $HIRS_MYSQL_ROOT_PWD ]; then
|
||||
# Create a 32 character random password
|
||||
|
@ -21,12 +21,21 @@ SCRIPT_DIR=$( dirname -- "$( readlink -f -- "$0"; )"; )
|
||||
mkdir -p $HIRS_CONF_DIR $LOG_DIR
|
||||
echo "SCRIPT_DIR is $SCRIPT_DIR" | tee -a "$LOG_FILE"
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
if [ -z "$LOG_FILE" ]; then
|
||||
LOG_FILE="$LOG_DIR$LOG_FILE_NAME"
|
||||
echo "using log file $LOG_FILE" | tee -a "$LOG_FILE"
|
||||
fi
|
||||
|
||||
if [ -z "$2" ]; then
|
||||
if [ -z "$PKI_PASS" ]; then
|
||||
if [ -f $ACA_PROP ]; then
|
||||
source $ACA_PROP
|
||||
if [ ! -z $hirs_pki_password ]; then
|
||||
PKI_PASS=$hirs_pki_password
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -z "$PKI_PASS" ]; then
|
||||
PKI_PASS=$(head -c 64 /dev/urandom | md5sum | tr -dc 'a-zA-Z0-9')
|
||||
echo "Using randomly generated password for the PKI key password" | tee -a "$LOG_FILE"
|
||||
echo "Using pki password=$PKI_PASS"
|
||||
|
Loading…
Reference in New Issue
Block a user