diff --git a/bin/prestart.sh b/bin/prestart.sh index d6df9fc..2632458 100755 --- a/bin/prestart.sh +++ b/bin/prestart.sh @@ -47,18 +47,19 @@ else # set a nice default permalink structure wp --allow-root option update permalink_structure '/%year%/%monthnum%/%postname%/' # set theme - if [ $WORDPRESS_ACTIVE_THEME ] + if [ -n "$WORDPRESS_ACTIVE_THEME" ] then wp --allow-root theme activate $WORDPRESS_ACTIVE_THEME fi - if [ $WORDPRESS_TEST_DATA ] + if [[ $WORDPRESS_TEST_DATA=true ]] then echo "installing WP test content" wp --allow-root plugin install wordpress-importer --activate curl -OL https://raw.githubusercontent.com/manovotny/wptest/master/wptest.xml wp --allow-root import wptest.xml --authors=create wp --allow-root plugin uninstall wordpress-importer --deactivate + chown -R www-data:www-data /var/www/html/wordpress/content/uploads/* rm wptest.xml fi fi diff --git a/setup.sh b/setup.sh index d762e1a..6689fc0 100755 --- a/setup.sh +++ b/setup.sh @@ -116,7 +116,7 @@ envcheck() { echo '# Environment variables for for WordPress site' > _env echo '# please include the scheme http:// or https:// in the URL variable' >> _env - echo 'WORDPRESS_URL=http://'wordpress.svc.${TRITON_ACCOUNT}.${TRITON_DC}.triton.zone >> _env + echo 'WORDPRESS_URL=http://'nginx.svc.${TRITON_ACCOUNT}.${TRITON_DC}.triton.zone >> _env echo 'WORDPRESS_SITE_TITLE=Autopilot Pattern WordPress test site' >> _env echo 'WORDPRESS_ADMIN_EMAIL=user@example.net' >> _env echo 'WORDPRESS_ADMIN_USER=admin-'$(cat /dev/urandom | LC_ALL=C tr -dc 'A-Za-z0-9' | head -c 3) >> _env