Update test.sh
This commit is contained in:
parent
3edd3309eb
commit
0760607c18
24
test.sh
24
test.sh
|
@ -13,29 +13,7 @@ apt install -y apache2 mysql-server php libapache2-mod-php php-mysql curl rsync
|
||||||
# ====== Secure MySQL Installation ======
|
# ====== Secure MySQL Installation ======
|
||||||
mysql -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '${DB_ROOT_PASSWORD}'; FLUSH PRIVILEGES;"
|
mysql -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '${DB_ROOT_PASSWORD}'; FLUSH PRIVILEGES;"
|
||||||
|
|
||||||
SECURE_MYSQL=$(expect -c "
|
mysql_secure_installation
|
||||||
set timeout 10
|
|
||||||
spawn mysql_secure_installation
|
|
||||||
expect \"Enter password for user root:\"
|
|
||||||
send \"${DB_ROOT_PASSWORD}\r\"
|
|
||||||
expect \"Press y|Y for Yes, any other key for No:\"
|
|
||||||
send \"y\r\"
|
|
||||||
expect \"New password:\"
|
|
||||||
send \"${DB_ROOT_PASSWORD}\r\"
|
|
||||||
expect \"Re-enter new password:\"
|
|
||||||
send \"${DB_ROOT_PASSWORD}\r\"
|
|
||||||
expect \"Remove anonymous users?\"
|
|
||||||
send \"y\r\"
|
|
||||||
expect \"Disallow root login remotely?\"
|
|
||||||
send \"y\r\"
|
|
||||||
expect \"Remove test database and access to it?\"
|
|
||||||
send \"y\r\"
|
|
||||||
expect \"Reload privilege tables now?\"
|
|
||||||
send \"y\r\"
|
|
||||||
expect eof
|
|
||||||
")
|
|
||||||
|
|
||||||
echo "$SECURE_MYSQL"
|
|
||||||
|
|
||||||
# ====== Create WordPress Database and User ======
|
# ====== Create WordPress Database and User ======
|
||||||
mysql -u root -p"${DB_ROOT_PASSWORD}" <<MYSQL_SCRIPT
|
mysql -u root -p"${DB_ROOT_PASSWORD}" <<MYSQL_SCRIPT
|
||||||
|
|
Loading…
Reference in New Issue