@@ -248,12 +248,12 @@ check_command wp core download --allow-root --force --debug --path="$WPATH"
248248
249249# Populate DB
250250mysql -uroot -p" $MARIADB_PASS " << MYSQL_SCRIPT
251- CREATE DATABASE " $WPDBNAME " ;
251+ CREATE DATABASE $WPDBNAME ;
252252CREATE USER '$WPDBUSER '@'localhost' IDENTIFIED BY '$WPDBPASS ';
253- GRANT ALL PRIVILEGES ON " $WPDBNAME " .* TO '$WPDBUSER '@'localhost';
253+ GRANT ALL PRIVILEGES ON $WPDBNAME .* TO '$WPDBUSER '@'localhost';
254254FLUSH PRIVILEGES;
255255MYSQL_SCRIPT
256- wp core config --allow-root --dbname=" $WPDBNAME " --dbuser=" $WPDBUSER " --dbpass=" $WPDBPASS " --dbhost=localhost --extra-php << PHP
256+ wp core config --allow-root --dbname=$WPDBNAME --dbuser=$WPDBUSER --dbpass=" $WPDBPASS " --dbhost=localhost --extra-php << PHP
257257define( 'WP_DEBUG', false );
258258define( 'WP_CACHE_KEY_SALT', 'wpredis_' );
259259define( 'WP_REDIS_MAXTTL', 9600);
@@ -267,15 +267,15 @@ echo "Wordpress DB: $WPDBPASS"
267267} >> " $MYCNF "
268268
269269# Install Wordpress
270- check_command wp core install --allow-root --url=
" http://$ADDRESS / " --title=Wordpress --admin_user=
" $WPADMINUSER " --admin_password=
" $WPADMINPASS " [email protected] --skip-email
270+ check_command wp core install --allow-root --url=http://
" $ADDRESS " / --title=Wordpress --admin_user=
$WPADMINUSER --admin_password=
" $WPADMINPASS " [email protected] --skip-email
271271echo " WP PASS: $WPADMINPASS " > /var/adminpass.txt
272272chown wordpress:wordpress /var/adminpass.txt
273273
274274# Create welcome post
275- check_command wget -q " $STATIC /welcome.txt"
275+ check_command wget -q $STATIC /welcome.txt
276276sed -i " s|wordpress_user_login|$WPADMINUSER |g" welcome.txt
277277sed -i " s|wordpress_password_login|$WPADMINPASS |g" welcome.txt
278- wp post create ./welcome.txt --post_title=' Tech and Me - Welcome' --post_status=publish --path=" $WPATH " --allow-root
278+ wp post create ./welcome.txt --post_title=' Tech and Me - Welcome' --post_status=publish --path=$WPATH --allow-root
279279rm -f welcome.txt
280280wp post delete 1 --force --allow-root
281281
@@ -303,7 +303,7 @@ run_static_script wp-permissions
303303
304304# Hardening security
305305# create .htaccess to protect uploads directory
306- cat > " $WPATH /wp-content/uploads/.htaccess" << 'EOL '
306+ cat > $WPATH /wp-content/uploads/.htaccess << 'EOL '
307307# Protect this file
308308<Files .htaccess>
309309Order Deny,Allow
@@ -334,10 +334,10 @@ sed -i "s|upload_max_filesize =.*|upload_max_filesize = 1000M|g" /etc/php/7.0/ap
334334apt install figlet -y
335335
336336# Generate $SSL_CONF
337- if [ ! -f " $SSL_CONF " ];
337+ if [ ! -f $SSL_CONF ];
338338 then
339- touch " $SSL_CONF "
340- cat << SSL_CREATE > " $SSL_CONF "
339+ touch $SSL_CONF
340+ cat << SSL_CREATE > $SSL_CONF
341341<VirtualHost *:443>
342342 Header add Strict-Transport-Security: "max-age=15768000;includeSubdomains"
343343 SSLEngine on
@@ -348,15 +348,15 @@ if [ ! -f "$SSL_CONF" ];
348348# ServerAlias www.example.com
349349
350350### SETTINGS ###
351- DocumentRoot " $WPATH "
352- <Directory " $WPATH " >
351+ DocumentRoot $WPATH
352+ <Directory $WPATH >
353353 Options Indexes FollowSymLinks MultiViews
354354 AllowOverride All
355355 Require all granted
356356 </Directory>
357357
358- SetEnv HOME " $WPATH "
359- SetEnv HTTP_HOME " $WPATH "
358+ SetEnv HOME $WPATH
359+ SetEnv HTTP_HOME $WPATH
360360
361361### LOCATION OF CERT FILES ###
362362 SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
@@ -374,10 +374,10 @@ sleep 3
374374fi
375375
376376# Generate $HTTP_CONF
377- if [ ! -f " $HTTP_CONF " ];
377+ if [ ! -f $HTTP_CONF ];
378378 then
379- touch " $HTTP_CONF "
380- cat << HTTP_CREATE > " $HTTP_CONF "
379+ touch $HTTP_CONF
380+ cat << HTTP_CREATE > $HTTP_CONF
381381
382382<VirtualHost *:80>
383383
@@ -387,8 +387,8 @@ if [ ! -f "$HTTP_CONF" ];
387387# ServerAlias www.example.com
388388
389389### SETTINGS ###
390- DocumentRoot " $WPATH "
391- <Directory " $WPATH " >
390+ DocumentRoot $WPATH
391+ <Directory $WPATH >
392392 Options Indexes FollowSymLinks MultiViews
393393 AllowOverride All
394394 Require all granted
0 commit comments