eole-mariadb/preservice/25-bdd-init

25 lines
388 B
Plaintext
Raw Normal View History

2018-04-12 16:12:42 +02:00
#!/bin/bash
#
# Initialize root password
# and secure MariaDB installation
#
ROLE=$(CreoleGet dbClusterPosition)
SECURE_CMD="mysql_secure_installation"
PASSWORD=$(pwgen -1 10)
2018-04-12 16:33:44 +02:00
passwd="/usr/share/eole/sbin/mariadbPwd"
logfile="/var/log/eole/maria-init.log"
2018-04-12 16:12:42 +02:00
${passwd} ${PASSWORD}
# Run secure installation script
2018-04-12 16:33:44 +02:00
${SECURE_CMD} > ${logfile} 2>&1 <<__EOF__
${PASSWORD}
2018-04-12 16:12:42 +02:00
y
n
y
y
y
y
2018-04-12 16:33:44 +02:00
__EOF__