-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install-wp.sh
executable file
·63 lines (54 loc) · 1.74 KB
/
install-wp.sh
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
#!/usr/bin/env bash
# ============================================
# = Ask some questions to make the fun going =
# ============================================
echo "Which kind of WordPress ? classic or multisite"
read type
if [ $type = "multisite" ]
then
echo "Would you prefer it on subdomain ? yes/no"
read subdomain
fi
echo "Which language? leave empty for English. Example for french: fr_FR"
read lang
echo "What is the future URL of your website?"
read url
echo "please enter the admin email:"
read email
echo "please enter the admin username:"
read wpusername
echo "please enter the admin password:"
read wppassword
echo "any path or something need to run wp-cli? example: lando"
read wppath
echo "delete this script when installation finished ? yes/no"
read delete
# =======================
# = The show must go on =
# =======================
if [ -z "$lang" ]
then
$wppath wp core download
else
$wppath wp core download --locale=$lang
fi
$wppath wp config create --prompt
if [ $type = "classic" ]
then
$wppath wp core install --url="$url" --title="Website" --admin_user="$wpusername" --admin_password="$wppassword" --admin_email="$email"
fi
if [ $type = "multisite" ] && [ $subdomain = "yes" ]
then
$wppath wp core multisite-install --url="$url" --title="Multisite" --admin_user="$wpusername" --admin_password="$wppassword" --admin_email="$email" --subdomains
fi
if [ $type = "multisite" ] && [ $subdomain = "no" ]
then
$wppath wp core multisite-install --url="$url" --title="Multisite" --admin_user="$wpusername" --admin_password="$wppassword" --admin_email="$email"
fi
$wppath wp option update timezone_string Europe/Paris
$wppath wp rewrite structure --hard '/%postname%'
$wppath wp rewrite flush --hard
if [ $delete = "yes" ]
then
rm install-wp.sh
fi