docker/wordpress/setup.sh

27 lines
927 B
Bash
Raw Normal View History

#!/bin/bash
# This script automates the setup of a fresh WordPress installation.
# Set environment variables if not already set
: ${WORDPRESS_TITLE:="WordPress Local"}
: ${WORDPRESS_ADMIN_USER:="admin"}
: ${WORDPRESS_ADMIN_PASSWORD:="password"}
: ${WORDPRESS_ADMIN_MAIL:="your@email.com"}
: ${WORDPRESS_LANGUAGE:="de_AT"}
# Do install step 1
curl -X POST -d "language=$WORDPRESS_LANGUAGE" 'http://wp.lan/wp-admin/install.php?step=1'
# Build the POST data for step 2
POST_DATA="weblog_title=$WORDPRESS_TITLE"
POST_DATA+="&user_name=$WORDPRESS_USER"
POST_DATA+="&admin_password=$ADMIN_PWORDPRESS_PASSWORDASSWORD"
POST_DATA+="&admin_password2=$ADMIN_PASSWORD"
POST_DATA+="&pw_weak=on"
POST_DATA+="&admin_email=$ADMIN_EMAIL"
POST_DATA+="&Submit=WordPress+installieren"
POST_DATA+="&language=$WORDPRESS_LANGUAGE"
# Make the POST request for setup step 2
curl -X POST -d "$POST_DATA" 'http://wp.lan/wp-admin/install.php?step=2'