|
|
@@ -9,32 +9,38 @@ hestia_module_mariadb_install() {
|
|
|
fi
|
|
|
|
|
|
echo "Installing database (MariaDB) module..."
|
|
|
- local mariadb_v='10.4'
|
|
|
+ local hmd="$HESTIA_INSTALL_DIR/../modules/mariadb.hmd"
|
|
|
+ local mariadb_version=$(osal_kv_read $hmd 'version')
|
|
|
|
|
|
osal_service_stop $OSAL_SERVICE_MARIADB > /dev/null 2>&1
|
|
|
hestia_config_backup 'mariadb-install' $OSAL_PATH_MARIADB_CONF $OSAL_DIR_MARIADB_CONF_D $OSAL_PATH_MARIADB_DATA
|
|
|
|
|
|
- if [ "$OS_TYPE" == 'ubuntu' ]; then
|
|
|
- echo "deb [arch=amd64] http://ams2.mirrors.digitalocean.com/mariadb/repo/$mariadb_v/$OS_TYPE $OS_CODENAME main" > $apt/mariadb.list
|
|
|
- APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xF1656F24C74CD1D8 > /dev/null 2>&1
|
|
|
- elif [ "$OS_TYPE" == 'debian' ]; then
|
|
|
- echo "deb [arch=amd64] http://ams2.mirrors.digitalocean.com/mariadb/repo/$mariadb_v/$OS_TYPE $OS_CODENAME main" > $apt/mariadb.list
|
|
|
- if [ "$OS_VERSION" -eq 8 ]; then
|
|
|
- APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key adv --recv-keys --keyserver keyserver.ubuntu.com CBCB082A1BB943DB > /dev/null 2>&1
|
|
|
+ # Setup repos
|
|
|
+ if [ "$OS_BASE" = 'debian' ]; then
|
|
|
+ cat > /etc/apt/sources.list.d/mariadb.list <<EOL
|
|
|
+# This file was added by Hestia Control Panel.
|
|
|
+deb [arch=amd64] https://mirror.mva-n.net/mariadb/repo/$mariadb_version/debian $OS_CODENAME main
|
|
|
+EOL
|
|
|
+ apt-key adv --fetch-keys 'https://mariadb.org/mariadb_release_signing_key.asc' > /dev/null 2>&1
|
|
|
+ elif [ "$OS_BASE" = 'ubuntu' ]; then
|
|
|
+ cat > /etc/apt/sources.list.d/mariadb.list <<EOL
|
|
|
+# This file was added by Hestia Control Panel.
|
|
|
+deb [arch=amd64] https://mirror.mva-n.net/mariadb/repo/$mariadb_version/ubuntu $OS_CODENAME main
|
|
|
+EOL
|
|
|
+ if [ "$OS_VERSION" = '16.04' ]; then
|
|
|
+ apt-key adv --fetch-keys 'http://mariadb.org/mariadb_release_signing_key.asc' > /dev/null 2>&1
|
|
|
else
|
|
|
- APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key adv --recv-keys --keyserver keyserver.ubuntu.com F1656F24C74CD1D8 > /dev/null 2>&1
|
|
|
+ apt-key adv --fetch-keys 'https://mariadb.org/mariadb_release_signing_key.asc' > /dev/null 2>&1
|
|
|
fi
|
|
|
- elif [ "$OS_TYPE" == 'centos' ]; then
|
|
|
+ elif [ "$OS_BASE" = 'rhel' ]; then
|
|
|
# Remove conflicting OS-provided packages
|
|
|
osal_package_remove mariadb-server mariadb-gssapi-server
|
|
|
|
|
|
cat > "/etc/yum.repos.d/mariadb.repo" <<EOL
|
|
|
-# This file is auto generated. Do not edit this file. Changes will be overwriten
|
|
|
-# Run 'hestia module mariadb info' or visit http://hestiacp.com for more info.
|
|
|
-# http://downloads.mariadb.org/mariadb/repositories/
|
|
|
+# This file was added by Hestia Control Panel.
|
|
|
[mariadb]
|
|
|
name = MariaDB
|
|
|
-baseurl = http://yum.mariadb.org/${mariadb_v}/${OS_TYPE}${OS_VERSION}-amd64
|
|
|
+baseurl = http://yum.mariadb.org/${mariadb_version}/${OS_TYPE}${OS_VERSION}-amd64
|
|
|
module_hotfixes=1
|
|
|
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
|
|
|
gpgcheck=1
|