Fetching contributors…
Cannot retrieve contributors at this time
executable file 247 lines (212 sloc) 4.58 KB
#!/bin/bash
###----------------------------------------###
###
### Octopus Aegir Installer
###
### Copyright (C) 2010-2016 Omega8.cc
### noc@omega8.cc 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="noc@omega8.cc"
_CLIENT_EMAIL="notify@omega8.cc"
_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-23-07-2016
_NOW=$(date +%y%m%d-%H%M 2>&1)
_NOW=${_NOW//[^0-9-]/}
_PLATFORMS_ONLY=NO
_PURGE_FOR_SEVEN=YES
_REDIS_M_VERSION=mod-03-05-2016
_SMALLCORE6=6.38.2
_SMALLCORE7=7.50.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}"
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.2
_CIVICRM_M6=4.1.6
_CIVICRM_M7=4.3.7
_COD=1.0-alpha5
_COMMERCE1=1.42
_COMMERCE2=2.38
_COMMONS2=2.27
_COMMONS3=3.38
_DRUPAL7="drupal-${_SMALLCORE7}"
_DRUPAL8="drupal-${_SMALLCORE8}"
_ERPAL=2.3
_GUARDR=2.34
_OPENACADEMY=1.1
_OPENAID=2.8
_OPENATRIUM7=2.65
_OPENBLOG=1.0-alpha3
_OPENCHURCH1=1.17-beta2
_OPENCHURCH2=2.2
_OPENDEALS=1.35
_OPENOUTREACH=1.31
_OPENPUBLIC=1.9
_OPENPUBLISH=1.0-beta7
_OPENSCHOLAR=3.28.0
_PANOPOLY=1.37
_RECRUITER=1.7
_RESTAURANT=1.13
_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-2016 Omega8.cc
### noc@omega8.cc www.omega8.cc
###
###----------------------------------------###