Commit 8c6a715e authored by root @ l1's avatar root @ l1

move generic init to init/generic.sh

parent bcee6035
#!/bin/bash
mkdir -p /data/uploads
mkdir -p /data/www-content
touch /data/www-content/.htaccess
touch /data/dump.sql
chown -R root:www-data /data
chmod -R 770 /data/uploads
chmod -R 750 /data/www-content
cd /data
git init
git config --local user.email "backup@IndieHosters"
git config --local user.name "IndieHosters backup"
......@@ -2,11 +2,16 @@ if [ $# -lt 4 ]; then
echo Usage: ./wordpress.sh https://exampledomain.com/ "Example Domain" "example" "example@elsewhere.com"
exit 1
fi
echo Unpacking latest WordPress into /data/www-content...
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
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
# pwgen is not part of the runtime lamp-git image:
apt-get update
apt-get install -y pwgen
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"
......@@ -51,6 +56,10 @@ php /root/wp-cli.phar --path="/data/www-content" --allow-root plugin activate in
php /root/wp-cli.phar --path="/data/www-content" --allow-root theme install sempress
php /root/wp-cli.phar --path="/data/www-content" --allow-root theme activate sempress
echo Making WordPress content folder writable for the webserver...
chown -R root:www-data /data/www-content
chmod 770 /data/www-content/wp-content
echo "user: $3" > /data/login.txt
echo "pass: $PWD" >> /data/login.txt
echo "Done, login details saved to /data/login.txt"
......@@ -11,22 +11,11 @@ do
sleep 1
done
mkdir -p /data/uploads
mkdir -p /data/www-content
touch /data/dump.sql
chown -R root:www-data /data
chmod -R 770 /data/uploads
chmod -R 750 /data/www-content
mysql < /data/dump.sql
source /etc/apache2/envvars
exec apache2 &
cd /data
git init
git config --local user.email "backup@IndieHosters"
git config --local user.name "IndieHosters backup"
while true; do
mysqldump --all-databases > dump.sql
......
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