# !/bin/bash sudo whoami sudo ls -l sudo DEBIAN_FRONTEND=noninteractive apt-get -y install mysql-client mysql-server python3 pip mysql-server vim mc wget curl # # su # #mysql has to be started this way as it doesn't work to call from /etc/init.d # /usr/bin/mysqld_safe & # sleep 10s # # Here we generate random passwords (thank you pwgen!). The first two are for mysql users, the last batch for random keys in wp-config.php # MYSQL_PASSWORD=`pwgen -c -n -1 12` # #This is so the passwords show up in logs. # echo mysql root password: $MYSQL_PASSWORD # echo $MYSQL_PASSWORD > /mysql-root-pw.txt # #there used to be a huge ugly line of sed and cat and pipe and stuff below, # #but thanks to @djfiander's thing at https://gist.github.com/djfiander/6141138 # #there isn't now. # mysqladmin -u root password $MYSQL_PASSWORD # mysql -uroot -p$MYSQL_PASSWORD -e "CREATE DATABASE wordpress; GRANT ALL PRIVILEGES ON wordpress.* TO 'wordpress'@'localhost' IDENTIFIED BY '$WORDPRESS_PASSWORD'; FLUSH PRIVILEGES;" # killall mysqld # sleep 10s # fi # supervisord -n