Update 'Apache-Installer.sh'

This commit is contained in:
tbergervoet
2018-10-15 13:25:19 +02:00
parent 1d76724ed1
commit 74d8d162db

View File

@@ -155,8 +155,9 @@ certbot --apache -n -d "$domain" -d "www.$domain" -m "$email" --hsts --redirect
##---------------## ##---------------##
if [ $wordpress = 1 ]; then if [ $wordpress = 1 ]; then
db_name="wp_1" db_suffix=`expr $(ls -l /var/www | grep -c ^d) - 1`
db_user="wp_1" db_name="wp_$db_suffix"
db_user="wp_$db_suffix"
db_pass=$(date +%s|sha256sum|base64|head -c 32) db_pass=$(date +%s|sha256sum|base64|head -c 32)
mysql -u root -p"$password" -e "CREATE DATABASE "$db_name" DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;" mysql -u root -p"$password" -e "CREATE DATABASE "$db_name" DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;"
mysql -u root -p"$password" -e "GRANT ALL ON "$db_name".* TO '"$db_user"'@'localhost' IDENTIFIED BY '"$db_pass"';" mysql -u root -p"$password" -e "GRANT ALL ON "$db_name".* TO '"$db_user"'@'localhost' IDENTIFIED BY '"$db_pass"';"