Add a script that automates the WordPress setup
This commit is contained in:
parent
fa6ddb58a5
commit
83e2ca18e9
1 changed files with 28 additions and 0 deletions
28
wordpress/setup.sh
Normal file
28
wordpress/setup.sh
Normal file
|
@ -0,0 +1,28 @@
|
|||
#!/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'
|
||||
|
||||
|
Loading…
Reference in a new issue