1
1
#! /bin/bash
2
2
if [ ! -f /usr/share/nginx/www/wp-config.php ]; then
3
3
# mysql has to be started this way as it doesn't work to call from /etc/init.d
4
- /usr/bin/mysqld_safe &
4
+ /usr/bin/mysqld_safe &
5
5
sleep 10s
6
6
# 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
7
7
WORDPRESS_DB=" wordpress"
8
8
MYSQL_PASSWORD=` pwgen -c -n -1 12`
9
9
WORDPRESS_PASSWORD=` pwgen -c -n -1 12`
10
- # This is so the passwords show up in logs.
10
+ # This is so the passwords show up in logs.
11
11
echo mysql root password: $MYSQL_PASSWORD
12
12
echo wordpress password: $WORDPRESS_PASSWORD
13
13
echo $MYSQL_PASSWORD > /mysql-root-pw.txt
@@ -30,12 +30,11 @@ if [ ! -f /usr/share/nginx/www/wp-config.php ]; then
30
30
unzip -o nginx-helper.* .zip -d /usr/share/nginx/www/wp-content/plugins
31
31
chown -R www-data:www-data /usr/share/nginx/www/wp-content/plugins/nginx-helper
32
32
33
- # Activate nginx plugin and set up pretty permalink structure once logged in
33
+ # Activate nginx plugin once logged in
34
34
cat << ENDL >> /usr/share/nginx/www/wp-config.php
35
35
\$ plugins = get_option( 'active_plugins' );
36
36
if ( count( \$ plugins ) === 0 ) {
37
37
require_once(ABSPATH .'/wp-admin/includes/plugin.php');
38
- \$ wp_rewrite->set_permalink_structure( '/%postname%/' );
39
38
\$ pluginsToActivate = array( 'nginx-helper/nginx-helper.php' );
40
39
foreach ( \$ pluginsToActivate as \$ plugin ) {
41
40
if ( !in_array( \$ plugin, \$ plugins ) ) {
0 commit comments