49
49
wp config set DISALLOW_FILE_EDIT true --raw --allow-root
50
50
wp config set WP_AUTO_UPDATE_CORE false --raw --allow-root
51
51
52
- if [ $WP_DEBUG ]
52
+ if [ " $WP_DEBUG " ]
53
53
then
54
54
wp config set WP_DEBUG true --raw --allow-root
55
55
wp config set WP_DEBUG_DISPLAY false --raw --allow-root
56
56
fi
57
57
58
- if [ $WP_SCRIPT_DEBUG ]
58
+ if [ " $WP_SCRIPT_DEBUG " ]
59
59
then
60
60
wp config set SCRIPT_DEBUG false --raw --allow-root
61
61
fi
62
62
63
- if [ -v $WP_MEMORY_LIMIT ]
63
+ if [ " $WP_MEMORY_LIMIT " ]
64
64
then
65
65
wp config set WP_MEMORY_LIMIT " $WP_MEMORY_LIMIT " --allow-root
66
66
wp config set WP_MAX_MEMORY_LIMIT " $WP_MEMORY_LIMIT " --allow-root
69
69
wp config set WP_MAX_MEMORY_LIMIT " ini_get( 'memory_limit' )" --raw --allow-root
70
70
fi
71
71
72
- if [ $DISABLE_WP_CRON ]
72
+ if [ " $DISABLE_WP_CRON " ]
73
73
then
74
74
wp config set DISABLE_WP_CRON true --allow-root
75
75
fi
76
76
77
- if [ $WP_UPLOADS_URL ]
77
+ if [ " $WP_UPLOADS_URL " ]
78
78
then
79
79
wp config set UPLOADS_URL " $WP_UPLOADS_URL " --allow-root
80
80
fi
81
81
82
82
# Enable Memcached object storage
83
- export MEMCACHED_HOST =$( jq -r ' .memcached_servers[0]' /secrets/credentials.json)
84
- if [ $MEMCACHED_HOST ]
83
+ memcached_host =$( jq -r ' .memcached_servers[0]' /secrets/credentials.json)
84
+ if [ " $memcached_host " ]
85
85
then
86
86
sed -i " /Add any custom values between this line/a \$ memcached_servers = array( 'default' => \$ credentials->memcached_servers );" wp-config.php
87
87
curl -s https://plugins.trac.wordpress.org/export/HEAD/memcached/trunk/object-cache.php > ./wp-content/object-cache.php
88
- chmod $FILE_MODE ./wp-content/object-cache.php
89
- chown $FILE_OWNER ./wp-content/object-cache.php
88
+ if [ " $FILE_MODE " ]
89
+ then
90
+ chmod " $FILE_MODE " ./wp-content/object-cache.php
91
+ fi
92
+ if [ " $FILE_OWNER " ]
93
+ then
94
+ chown " $FILE_OWNER " ./wp-content/object-cache.php
95
+ fi
90
96
fi
91
97
92
- if [ $WP_CONTENT_URL ]
98
+ if [ " $WP_CONTENT_URL " ]
93
99
then
94
100
wp config set WP_CONTENT_URL " $WP_CONTENT_URL " --allow-root
95
101
fi
102
+ fi
96
103
97
- if [ $WP_THEME_INSTALL ]
98
- then
99
- wp theme install " $WP_THEME_INSTALL " --allow-root
100
- fi
104
+ wp core install --url=
" localhost" --title=
" DockPress Site" --admin_user=
" admin" --admin_password=
" password" --admin_email=
" [email protected] " --skip-email --allow-root
101
105
102
- if [ $WP_THEME_ACTIVATE ]
103
- then
104
- wp theme activate " $WP_THEME_ACTIVATE " --allow-root
105
- fi
106
+ if [ " $WP_THEME_INSTALL " ]
107
+ then
108
+ wp theme install " $WP_THEME_INSTALL " --allow-root
109
+ fi
106
110
107
- if [ $WP_PLUGIN_INSTALL ]
108
- then
109
- wp plugin install " $WP_PLUGIN_INSTALL " --allow-root
110
- fi
111
+ if [ " $WP_THEME_ACTIVATE " ]
112
+ then
113
+ wp theme activate " $WP_THEME_ACTIVATE " --allow-root
114
+ fi
111
115
112
- if [ $WP_PLUGIN_ACTIVATE ]
113
- then
114
- wp plugin activate " $WP_PLUGIN_ACTIVATE " --allow-root
115
- fi
116
+ if [ " $WP_PLUGIN_INSTALL " ]
117
+ then
118
+ wp plugin install " $WP_PLUGIN_INSTALL " --allow-root
119
+ fi
120
+
121
+ if [ " $WP_PLUGIN_ACTIVATE " ]
122
+ then
123
+ wp plugin activate " $WP_PLUGIN_ACTIVATE " --allow-root
116
124
fi
117
125
118
126
# Remove crapware plugins from the WordPress installation
119
- if [ $REMOVE_CRAP_PLUGINS ]
127
+ if [ " $REMOVE_CRAP_PLUGINS " ]
120
128
then
121
129
rm -rf wp-content/plugins/akismet/
122
130
rm -rf wp-content/plugins/hello.php
@@ -126,5 +134,4 @@ if [ ! -d wp-content/uploads ]
126
134
then
127
135
echo " 📁 Creating uploads directory"
128
136
mkdir wp-content/uploads
129
- chmod a+rw wp-content/uploads
130
137
fi
0 commit comments