This repository was archived by the owner on Feb 10, 2023. It is now read-only.
Repository navigation
Expand file tree
/
Copy pathstart.sh
More file actions
93 lines (73 loc) · 2.41 KB
/
Copy pathstart.sh
File metadata and controls
93 lines (73 loc) · 2.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#!/bin/sh
if [ -z "$WP_VERSION" ]; then
WP_VERSION=latest
fi
if [ -z "$WP_LOCALE" ]; then
WP_LOCALE=en_US
fi
if [ -z "$WP_URL" ]; then
WP_URL=localhost
fi
if [ -z "$WP_PATH" ]; then
WP_PATH=/var/www/html
fi
if [ -z "$WP_TITLE" ]; then
WP_TITLE=WordPress
fi
if [ -z "$WP_USER" ]; then
WP_USER=admin
fi
if [ -z "$WP_PASS" ]; then
WP_PASS=password
fi
if [ -z "$WP_EMAIL" ]; then
WP_EMAIL=admin@localhost.dev
fi
if [ -z "$MYSQL_HOST" ]; then
MYSQL_HOST=localhost
fi
if [ -z "$MYSQL_USER" ]; then
MYSQL_USER=root
fi
if [ -z "$MYSQL_PASS" ]; then
MYSQL_PASS=root
fi
if [ ! -f "${WP_PATH}/wp-config.php" ] || [ ${WP_INSTALL} == "new" ]; then
mkdir -p ${WP_PATH}
if [ -f "${WP_PATH}/wp-config.php" ]; then
rm -rf ${WP_PATH}/*
wp core download --path=${WP_PATH} --version=${WP_VERSION} --locale=${WP_LOCALE}
wp config create --path=${WP_PATH} --dbname=${MYSQL_DB} --dbuser=${MYSQL_USER} --dbpass=${MYSQL_PASS} --dbhost=${MYSQL_HOST}
wp db drop --yes --path=${WP_PATH}
else
wp core download --path=${WP_PATH} --version=${WP_VERSION} --locale=${WP_LOCALE}
wp config create --path=${WP_PATH} --dbname=${MYSQL_DB} --dbuser=${MYSQL_USER} --dbpass=${MYSQL_PASS} --dbhost=${MYSQL_HOST}
fi
sed -i -e "s~\$table_prefix = 'wp_';~\$table_prefix = 'wp_';\ndefine( 'WP_DEBUG', true );\ndefine( 'WP_DEBUG_LOG', true );~g" ${WP_PATH}/wp-config.php
sleep 10
wp db create --path=${WP_PATH}
wp core install --path=${WP_PATH} --url=${WP_URL} --title="${WP_TITLE}" --admin_user=${WP_USER} --admin_password=${WP_PASS} --admin_email=${WP_EMAIL}
if [ ! -z "$WP_PLUGINS" ]; then
IFS=' ' read -ra plugins <<< "${WP_PLUGINS}"
for plugin in "${plugins[@]}"; do
echo "Installung Plugin ${plugin}...";
wp plugin install ${plugin} --path=${WP_PATH} --activate
done
fi
if [ ! -z "$WP_THEMES" ]; then
IFS=' ' read -ra themes <<< "${WP_THEMES}"
for themes in "${theme[@]}"; do
echo "Installing Plugin ${theme}...";
wp theme install ${theme} --path=${WP_PATH}
done
fi
if [ ! -z "$WP_ACTIVE_THEME" ]; then
wp theme activate ${WP_ACTIVE_THEME} --path=${WP_PATH}
fi
wp plugin update --all
wp theme update --all
wp language core update
wp language plugin update --all
wp language theme update --all
fi
tail -f /dev/null