-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebbuild
executable file
·81 lines (66 loc) · 1.95 KB
/
webbuild
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
#!/bin/bash
#Get Current run directory directory
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
EXPORT DIR
#Getting .env variables
echo "Setting variables from wb.conf file"
echo ""
set -o allexport
source $DIR/wb.conf
DEBIAN_FRONTEND=noninteractive apt
apt --yes update
apt --yes install unzip jq
#Get MySQL Root Password and put it in a variable
rootdbpassword=$(grep root_mysql /root/.digitalocean_password | sed 's#"##g' | sed 's#root_mysql_pass=##g')
echo "Removing Root MySQL Configuration file"
if [ -f /root/.my.cnf ]; then
rm /root/.my.cnf
fi
echo "Creating New Root MySQL Configuration file"
echo "[client]" >> /root/.my.cnf
echo "user=root" >> /root/.my.cnf
echo "password=$rootdbpassword" >> /root/.my.cnf
echo "Changing Permissions on Root MySQL Configuration file"
chmod 600 /root/.my.cnf
echo "Wordpress Plugins & Themes Setup"
echo ""
# Adding an autoupdater to .bashrc
if ! grep -q "wbupdate" /root/.bashrc; then
echo "function wbupdate {
rm -R ~/webbuild-setup
git clone https://github.com/jaskipper/webbuild-setup.git
}
function pluginsupdate {
/root/webbuild-setup/install-files/skipperplugins
}" >> /root/.bashrc
source .bashrc
fi
# Setting correct server Timezone
echo -e "Updating Server Time Zone"
timedatectl set-timezone $TIMEZONE
$DIR/install-files/wordpress
echo "Installing Essential Wordpress Plugins"
$DIR/install-files/skipperplugins
$DIR/install-files/mpplugins
if [ $CHURCHCRM_INSTALL = "yes" ];
then
echo "Installing ChurchCRM"
$DIR/install-files/churchcrm
fi #End ChurchCRM
if [ $OWNCLOUD_INSTALL = "yes" ]
then
echo "Installing OwnCloud"
$DIR/install-files/owncloud
fi
# Securing MySQL
mysql -u root <<-EOF
DELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('localhost', '127.0.0.1', '::1');
DELETE FROM mysql.user WHERE User='';
DELETE FROM mysql.db WHERE Db='test' OR Db='test_%';
FLUSH PRIVILEGES;
EOF
if [ $SSL_INSTALL = "yes" ];
then
echo "Installing SSL"
$DIR/install-files/sslsetup
fi