Merge branch 'master' into dist/eole/2.6.2/master

This commit is contained in:
Philippe Caseiro 2018-04-12 14:10:43 +02:00
commit 5e98dafab2
1 changed files with 8 additions and 11 deletions

View File

@ -1,5 +1,4 @@
#!/bin/bash
#
# Initialize root password
# and secure MariaDB installation
@ -7,26 +6,24 @@
function genPasswordToFile()
{
local file=${1}
pwgen -1 10 > ${file}
chmod 600 ${file}
local file=${1}
pwgen -1 10 > ${file}
chmod 600 ${file}
}
ROLE=$(CreoleGet dbClusterPosition)
WRITERFILE="/root/.bddadm"
SECURE_CMD="mysql_secure_installation"
oldPass=""
[[ ${ROLE} == "Node" ]] && exit 0
[[ -e ${WRITERFILE} ]] && exit 0
#[[ ${ROLE} == "Node" ]] && exit 0
[[ -e ${WRITERFILE} ]] && oldPass=$(< ${WRITERFILE})
genPasswordToFile ${WRITERFILE}
pass=$(< ${WRITERFILE})
# Run secure installation script
${SECURE_CMD} <<__EOF__
${oldPass}
y
${pass}
${pass}
@ -34,4 +31,4 @@ y
y
y
y
__EOF__
__EOF__