forked from omega8cc/boa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOCTOPUS.sh.txt
executable file
·250 lines (216 loc) · 4.66 KB
/
OCTOPUS.sh.txt
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
#!/bin/bash
###----------------------------------------###
###
### Octopus Aegir Installer
###
### Copyright (C) 2010-2017 Omega8.cc
### [email protected] www.omega8.cc
###
### This program is free software. You can
### redistribute it and/or modify it under
### the terms of the GNU GPL as published by
### the Free Software Foundation, version 2
### or later.
###
### This program is distributed in the hope
### that it will be useful, but WITHOUT ANY
### WARRANTY; without even the implied
### warranty of MERCHANTABILITY or FITNESS
### FOR A PARTICULAR PURPOSE. See the GNU GPL
### for more details.
###
### You should have received a copy of the
### GNU GPL along with this program.
### If not, see http://www.gnu.org/licenses/
###
### Code: https://github.com/omega8cc/boa
###
###----------------------------------------###
###
### Default values for main variables
###
_USER=o1
_MY_EMAIL="[email protected]"
_CLIENT_EMAIL="[email protected]"
_CLIENT_OPTION=SSD
_CLIENT_SUBSCR=Y
_CLIENT_CORES=8
###
### Required by AegirSetupA script, running in
### the same env, to avoid chicken/egg race.
###
export _USER="${_USER}"
###
### Variables
###
_DRUSH_VERSION=micro-8-07-02-2017
_NOW=$(date +%y%m%d-%H%M 2>&1)
_NOW=${_NOW//[^0-9-]/}
_PLATFORMS_ONLY=NO
_PURGE_FOR_SEVEN=YES
_REDIS_E_VERSION=mod-09-02-2017
_REDIS_M_VERSION=mod-14-02-2017
_SMALLCORE6=6.38.2
_SMALLCORE7=7.56.1
_SMALLCORE8=8.0.5
_SPINNER=YES
_T_BUILD=HEAD
_TODAY=$(date +%y%m%d 2>&1)
_TODAY=${_TODAY//[^0-9]/}
_F_TIME=$(date 2>&1)
_USRG=users
_WEBG=www-data
PATH=/usr/local/bin:/usr/local/sbin:/opt/local/bin:/usr/bin:/usr/sbin:/bin:/sbin
SHELL=/bin/bash
if [ -n "${STY+x}" ]; then
_SPINNER=NO
fi
###
### Instance specific variables
###
_WEB="${_USER}.web"
_DOMAIN="${_USER}.$(uname -n 2>&1)"
_ROOT="/data/disk/${_USER}"
_THIS_DB_PORT=3306
octCnf="/root/.${_USER}.octopus.cnf"
octInc="${_ROOT}/config/includes"
octTpl="${_ROOT}/.drush/sys/provision/http/Provision/Config/Nginx"
###
### Helper variables
###
bldPth="/opt/tmp/boa"
crlGet="-L --max-redirs 10 -k -s --retry 10 --retry-delay 5 -A iCab"
filIncO="octopus.sh.cnf"
gCb="git clone --branch"
gitHub="https://github.com/omega8cc"
gitLab="https://gitlab.com/omega8cc"
libFnc="${bldPth}/lib/functions"
tocIncO="${filIncO}.${_USER}"
vBs="/var/backups"
###
### Distributions
###
_AGOV=3.6
_CIVICRM_M6=4.1.6
_CIVICRM_M7=4.3.7
_COD=1.0-alpha5
_COMMERCE1=1.48
_COMMERCE2=2.48
_COMMONS2=2.27
_COMMONS3=3.44
_DRUPAL7="drupal-${_SMALLCORE7}"
_DRUPAL8="drupal-${_SMALLCORE8}"
_ERPAL=2.3
_GUARDR=2.36
_OPENACADEMY=1.1
_OPENAID=2.8
_OPENATRIUM7=2.617
_OPENBLOG=1.0-alpha3
_OPENCHURCH1=1.17-beta2
_OPENCHURCH2=2.2
_OPENDEALS=1.35
_OPENLUCIUS=1.7
_OPENOUTREACH=1.41
_OPENPUBLIC=1.12
_OPENPUBLISH=1.0-beta7
_OPENSCHOLAR=3.28.0
_OPIGNOLMS=1.25
_PANOPOLY=1.46
_RECRUITER=1.7
_RESTAURANT=1.15
_UBERCART6=2.15
_UBERCART7=3.10
###
### Clean pid files on exit
###
clean_pid_exit() {
rm -f /var/run/boa_wait.pid
rm -f /var/run/boa_run.pid
service cron start &> /dev/null
exit 1
}
###
### Panic on missing include
###
panic_exit() {
echo
echo " EXIT: Required lib file not available?"
echo " EXIT: $1"
echo " EXIT: Cannot continue"
echo " EXIT: Bye (0)"
echo
clean_pid_exit
}
###
### Include default settings and basic functions
###
if [ -e "${vBs}/${tocIncO}" ]; then
source "${vBs}/${tocIncO}"
tInc="${vBs}/${tocIncO}"
elif [ -e "${vBs}/${filIncO}" ]; then
source "${vBs}/${filIncO}"
tInc="${vBs}/${filIncO}"
else
panic_exit "${tInc}"
fi
###
### Download helpers and libs
###
download_helpers_libs
###
### Include shared functions
###
_FL="helper dns satellite"
for f in ${_FL}; do
[ -r "${libFnc}/${f}.sh.inc" ] || panic_exit "${f}"
source "${libFnc}/${f}.sh.inc"
done
###
### Welcome msg
###
echo " "
msg "Skynet Agent v.${_X_VERSION} welcomes you aboard!"
echo " "
sleep 3
###
### More local default variables
###
_LASTNUM=001
_LAST_HMR=001
_LAST_ALL=001
_DISTRO=001
_HM_DISTRO=001
_ALL_DISTRO=001
_STATUS=INIT
###
### Misc checks
###
satellite_check_php_compatibility
satellite_check_octopus_versus_barracuda_version
satellite_if_head_github_connection_test
satellite_if_sql_exception_test
satellite_if_running_as_root_octopus
satellite_check_sanitize_user_name
satellite_if_localhost_mode_magic
satellite_check_sanitize_domain_name
satellite_detect_vm_family
check_git_repos
###
### Main procedures
###
satellite_cnf
satellite_if_init_or_upgrade
satellite_if_major_upgrade
satellite_if_check_dns
satellite_checkpoint
satellite_pre_cleanup
satellite_make
satellite_post_cleanup
exit 0
###----------------------------------------###
###
### Octopus Aegir Installer
### Copyright (C) 2010-2017 Omega8.cc
### [email protected] www.omega8.cc
###
###----------------------------------------###