2021-03-19 12:50:47 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
package_manager="yum"
|
|
|
|
package_sysname="onlyoffice";
|
2021-05-20 14:39:38 +00:00
|
|
|
product="appserver"
|
2021-10-11 09:08:29 +00:00
|
|
|
GIT_BRANCH="develop"
|
2021-03-19 12:50:47 +00:00
|
|
|
package_services="";
|
|
|
|
RES_APP_INSTALLED="is already installed";
|
|
|
|
RES_APP_CHECK_PORTS="uses ports"
|
|
|
|
RES_CHECK_PORTS="please, make sure that the ports are free.";
|
2021-07-13 15:03:48 +00:00
|
|
|
RES_INSTALL_SUCCESS="Thank you for installing ONLYOFFICE ${product^^}.";
|
2021-03-19 12:50:47 +00:00
|
|
|
RES_QUESTIONS="In case you have any questions contact us via http://support.onlyoffice.com or visit our forum at http://dev.onlyoffice.org"
|
2021-09-30 14:41:11 +00:00
|
|
|
RES_MARIADB="To continue the installation, you need to remove MariaDB"
|
2021-03-19 12:50:47 +00:00
|
|
|
|
2021-07-13 15:03:48 +00:00
|
|
|
res_unsupported_version () {
|
|
|
|
RES_CHOICE="Please, enter Y or N"
|
|
|
|
RES_CHOICE_INSTALLATION="Continue installation [Y/N]? "
|
|
|
|
RES_UNSPPORTED_VERSION="You have an unsupported version of $DIST installed"
|
|
|
|
RES_SELECT_INSTALLATION="Select 'N' to cancel the ONLYOFFICE installation (recommended). Select 'Y' to continue installing ONLYOFFICE"
|
|
|
|
RES_ERROR_REMINDER="Please note, that if you continue with the installation, there may be errors"
|
|
|
|
}
|
|
|
|
|
2021-03-19 12:50:47 +00:00
|
|
|
while [ "$1" != "" ]; do
|
|
|
|
case $1 in
|
|
|
|
|
|
|
|
-u | --update )
|
|
|
|
if [ "$2" != "" ]; then
|
|
|
|
UPDATE=$2
|
|
|
|
shift
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
|
2021-10-11 09:08:29 +00:00
|
|
|
-gb | --gitbranch )
|
|
|
|
if [ "$2" != "" ]; then
|
|
|
|
PARAMETERS="$PARAMETERS ${1}";
|
|
|
|
GIT_BRANCH=$2
|
|
|
|
shift
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
|
2021-09-30 12:05:43 +00:00
|
|
|
-ls | --localscripts )
|
2021-03-19 12:50:47 +00:00
|
|
|
if [ "$2" != "" ]; then
|
|
|
|
LOCAL_SCRIPTS=$2
|
|
|
|
shift
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
|
2021-12-10 13:26:34 +00:00
|
|
|
-skiphc | --skiphardwarecheck )
|
|
|
|
if [ "$2" != "" ]; then
|
|
|
|
SKIP_HARDWARE_CHECK=$2
|
|
|
|
shift
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
|
2021-03-19 12:50:47 +00:00
|
|
|
-? | -h | --help )
|
|
|
|
echo " Usage $0 [PARAMETER] [[PARAMETER], ...]"
|
|
|
|
echo " Parameters:"
|
|
|
|
echo " -u, --update use to update existing components (true|false)"
|
|
|
|
echo " -ls, --local_scripts use 'true' to run local scripts (true|false)"
|
|
|
|
echo " -?, -h, --help this help"
|
|
|
|
echo
|
|
|
|
exit 0
|
|
|
|
;;
|
|
|
|
|
|
|
|
esac
|
|
|
|
shift
|
|
|
|
done
|
|
|
|
|
|
|
|
if [ -z "${UPDATE}" ]; then
|
|
|
|
UPDATE="false";
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -z "${LOCAL_SCRIPTS}" ]; then
|
2021-06-09 15:48:42 +00:00
|
|
|
LOCAL_SCRIPTS="false";
|
2021-03-19 12:50:47 +00:00
|
|
|
fi
|
|
|
|
|
2021-12-10 13:26:34 +00:00
|
|
|
if [ -z "${SKIP_HARDWARE_CHECK}" ]; then
|
|
|
|
SKIP_HARDWARE_CHECK="false";
|
|
|
|
fi
|
|
|
|
|
2021-03-19 12:50:47 +00:00
|
|
|
cat > /etc/yum.repos.d/onlyoffice.repo <<END
|
|
|
|
[onlyoffice]
|
|
|
|
name=onlyoffice repo
|
|
|
|
baseurl=http://download.onlyoffice.com/repo/centos/main/noarch/
|
|
|
|
gpgcheck=1
|
|
|
|
enabled=1
|
|
|
|
gpgkey=http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x8320CA65CB2DE8E5
|
|
|
|
END
|
|
|
|
|
|
|
|
cat > /etc/yum.repos.d/onlyoffice4testing.repo <<END
|
|
|
|
[onlyoffice4testing]
|
|
|
|
name=onlyoffice4testing repo
|
|
|
|
baseurl=http://static.teamlab.info.s3.amazonaws.com/repo/4testing/centos/main/noarch/
|
|
|
|
gpgcheck=1
|
|
|
|
enabled=1
|
|
|
|
gpgkey=http://static.teamlab.info.s3.amazonaws.com/k8s
|
|
|
|
END
|
|
|
|
|
2021-06-09 15:48:42 +00:00
|
|
|
#DOWNLOAD_URL_PREFIX="https://download.onlyoffice.com/install-appserver/install-RedHat"
|
2021-10-11 09:08:29 +00:00
|
|
|
DOWNLOAD_URL_PREFIX="https://raw.githubusercontent.com/ONLYOFFICE/${product}/${GIT_BRANCH}/build/install/OneClickInstall/install-RedHat"
|
2021-03-19 12:50:47 +00:00
|
|
|
|
|
|
|
if [ "$LOCAL_SCRIPTS" = "true" ]; then
|
2021-12-10 13:26:34 +00:00
|
|
|
source install-RedHat/tools.sh
|
2021-03-19 12:50:47 +00:00
|
|
|
source install-RedHat/bootstrap.sh
|
|
|
|
source install-RedHat/check-ports.sh
|
|
|
|
source install-RedHat/install-preq.sh
|
|
|
|
source install-RedHat/install-app.sh
|
|
|
|
else
|
2021-12-10 13:26:34 +00:00
|
|
|
source <(curl ${DOWNLOAD_URL_PREFIX}/tools.sh)
|
2021-03-19 12:50:47 +00:00
|
|
|
source <(curl ${DOWNLOAD_URL_PREFIX}/bootstrap.sh)
|
|
|
|
source <(curl ${DOWNLOAD_URL_PREFIX}/check-ports.sh)
|
|
|
|
source <(curl ${DOWNLOAD_URL_PREFIX}/install-preq.sh)
|
|
|
|
source <(curl ${DOWNLOAD_URL_PREFIX}/install-app.sh)
|
|
|
|
fi
|