Skip to content

Commit

Permalink
Improve MariaDB installer, add mirror repo option
Browse files Browse the repository at this point in the history
  • Loading branch information
joglomedia committed May 3, 2024
1 parent 80dd7bf commit f1fa38c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .env.dist
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ MYSQL_SERVER="mariadb"
MYSQL_VERSION="11.1"

# MySQL / MariaDB repo mirror base URL, example: https://ftp.osuosl.org/pub/mariadb
MYQL_REPO_MIRROR_URL=""
MYSQL_REPO_MIRROR_URL=""

# Securing MySQL installation.
MYSQL_SECURE_INSTALL=true
Expand Down
6 changes: 3 additions & 3 deletions scripts/install_mariadb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function add_mariadb_repo() {
;;
esac

if [[ "${MYQL_REPO_MIRROR_URL}x" == "x" ]]; then
if [[ "${MYSQL_REPO_MIRROR_URL}x" == "x" ]]; then
# Add MariaDB official repo.
MARIADB_REPO_SETUP_URL="https://downloads.mariadb.com/MariaDB/mariadb_repo_setup"

Expand All @@ -55,7 +55,7 @@ function add_mariadb_repo() {
fi
else
# Add MariaDB mirror repo.
local MARIADB_REPO_URL="${MYQL_REPO_MIRROR_URL}/repo/${MYSQL_VERSION}/${DISTRIB_NAME}"
local MARIADB_REPO_URL="${MYSQL_REPO_MIRROR_URL}/repo/${MYSQL_VERSION}/${DISTRIB_NAME}"

if curl -sLI "${MARIADB_REPO_URL}/dists/${RELEASE_NAME}/Release" | grep -q "HTTP/[.12]* [2].."; then
run bash -c "curl -fsSL https://mariadb.org/mariadb_release_signing_key.pgp | gpg --dearmor --yes -o /usr/share/keyrings/mariadb-keyring.gpg" && \
Expand All @@ -65,7 +65,7 @@ function add_mariadb_repo() {
run bash -c "echo '#deb-src [signed-by=/usr/share/keyrings/mariadb-keyring.gpg] ${MARIADB_REPO_URL} ${RELEASE_NAME} main' >> /etc/apt/sources.list.d/mariadb.list" && \
run apt-get update --allow-releaseinfo-change -q -y
else
error "MariaDB ${MYSQL_VERSION} release at mirror ${MYQL_REPO_MIRROR_URL} not found."
error "MariaDB ${MYSQL_VERSION} release at mirror ${MYSQL_REPO_MIRROR_URL} not found."
fi
fi
}
Expand Down

0 comments on commit f1fa38c

Please sign in to comment.