diff --git a/lamp-20-04/files/etc/update-motd.d/99-one-click b/lamp-20-04/files/etc/update-motd.d/99-one-click index 251198c..33ca844 100755 --- a/lamp-20-04/files/etc/update-motd.d/99-one-click +++ b/lamp-20-04/files/etc/update-motd.d/99-one-click @@ -3,6 +3,32 @@ # Configured as part of the DigitalOcean 1-Click Image build process myip=$(hostname -I | awk '{print$1}') +if [ -f "/root/.digitalocean_dbaas_credentials" ]; +then +DBAAS_PROTOCOL=$(sed -n "s/^db_protocol=\"\(.*\)\"$/\1/p" /root/.digitalocean_dbaas_credentials) +DBAAS_HOST=$(sed -n "s/^db_host=\"\(.*\)\"$/\1/p" /root/.digitalocean_dbaas_credentials) +DBAAS_PORT=$(sed -n "s/^db_port=\"\(.*\)\"$/\1/p" /root/.digitalocean_dbaas_credentials) +DBAAS_USERNAME=$(sed -n "s/^db_username=\"\(.*\)\"$/\1/p" /root/.digitalocean_dbaas_credentials) +DBAAS_DATABASE_NAME=$(sed -n "s/^db_database=\"\(.*\)\"$/\1/p" /root/.digitalocean_dbaas_credentials) +DBAAS_PASSWORD=$(sed -n "s/^db_password=\"\(.*\)\"$/\1/p" /root/.digitalocean_dbaas_credentials) + +db_message=" * DBAAS instance of MySQL is configured. Credentials are: + Protocol: $DBAAS_PROTOCOL + Host: $DBAAS_HOST + Port: $DBAAS_PORT + Username: $DBAAS_USERNAME + Database name: $DBAAS_DATABASE_NAME + Password: $DBAAS_PASSWORD +" + +else +LOCAL_DBAAS_PASSWORD=$(sed -n "s/^root_mysql_pass=\"\(.*\)\"$/\1/p" /root/.digitalocean_password) +db_message=" * Local instance of MySQL is configured. + Root password is: $LOCAL_DBAAS_PASSWORD +" + +fi + cat < /etc/mysql/debian.cnf <