Automating a WordPress install
This line is long and hard to read with many commands jammed inside:


mysql --defaults-file=~/.my.cnf -e "create database $MYSQL_DB; create user "$MYSQL_USER"@localhost; set password for "$MYSQL_USER"@localhost = PASSWORD(\""$MYSQL_USER_PASS"\"); GRANT ALL PRIVILEGES ON "$MYSQL_DB".* TO "$MYSQL_USER"@localhost IDENTIFIED BY '"$MYSQL_USER_PASS"'; flush privileges;"



A more readable way to write this:

cat &lt;&lt; EOF | mysql --defaults-file=~/.my.cnf 
create database $MYSQL_DB;
create user "$MYSQL_USER"@localhost;
set password for "$MYSQL_USER"@localhost = PASSWORD(\""$MYSQL_USER_PASS"\");
GRANT ALL PRIVILEGES ON "$MYSQL_DB".* TO "$MYSQL_USER"@localhost IDENTIFIED BY '"$MYSQL_USER_PASS"';
flush privileges;
EOF


Drop the -r here, as that's useful for recursively removing directories, but you have a simple file here:

rm -r ~/.my.cnf


It seems the script is designed to setup a single WordPress site per system. It would be useful to extract the logic of conducting a WordPress site, so that you could setup multiple sites per system easily if needed.