Merge branch 'master' into dist/eole/2.6.2/master
This commit is contained in:
commit
8cf9168763
35
pretemplate/25-bdd-init
Normal file
35
pretemplate/25-bdd-init
Normal file
@ -0,0 +1,35 @@
|
||||
#!/bin/bash
|
||||
|
||||
#
|
||||
# Initialize root password
|
||||
# and secure MariaDB installation
|
||||
#
|
||||
|
||||
function genPasswordToFile()
|
||||
{
|
||||
local file=${1}
|
||||
pwgen -1 10 > ${file}
|
||||
chmod 600 ${file}
|
||||
}
|
||||
|
||||
WRITERFILE="/root/.bddadm"
|
||||
SECURE_CMD="mysql_secure_installation"
|
||||
|
||||
|
||||
[[ -e ${WRITERFILE} ]] && exit 0
|
||||
|
||||
genPasswordToFile ${WRITERFILE}
|
||||
|
||||
pass=$(< ${WRITERFILE})
|
||||
|
||||
# Run secure installation script
|
||||
${SECURE_CMD} <<__EOF__
|
||||
|
||||
y
|
||||
${pass}
|
||||
${pass}
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
__EOF__
|
Loading…
Reference in New Issue
Block a user