Commit 7c008182 authored by root @ l1's avatar root @ l1

use wp-cli for init/

parent 23aa12be
if [ $# -lt 4 ]; then
echo Usage: ./ "Example Domain" "example" ""
exit 1
echo Unpacking latest WordPress into /data/www-content...
curl -L | tar xz
rm -rf /data/www-content
mv wordpress /data/www-content
echo Creating wp-config.php...
mv wp-config.php /data/www-content/wp-config.php
curl -L >> /data/www-content/wp-config.php
echo Setting ownership and permissions...
chown -R root:www-data /data
chmod -R 600 /data
chmod -R 650 /data/www-content
chmod -R 770 /data/www-content/wp-content
echo Starting MySQL so that you can import wordpress.sql...
curl -O
php /root/wp-cli.phar --path="/data/www-content" --allow-root core download
php /root/wp-cli.phar --path="/data/www-content" --allow-root core config --dbname=wordpress --dbuser=root
php /root/wp-cli.phar --path="/data/www-content" --allow-root db create
PWD=`pwgen 40 1`
php /root/wp-cli.phar --path="/data/www-content" --allow-root core install \
--url="$1" --title="$2" --admin_user="$3" --admin_password="$PWD" --admin_email="$4"
php /root/wp-cli.phar --path="/data/www-content" --allow-root plugin install wordpress-https
php /root/wp-cli.phar --path="/data/www-content" --allow-root plugin activate wordpress-https
echo "user: $3" > /data/login.txt
echo "pass: $PWD" >> /data/login.txt
echo "Done, login details saved to /data/login.txt"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment