From c05e3d71c982b7c6c9221e5a586c6832afa5d70f Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Mon, 2 Jun 2025 11:24:29 +0200 Subject: [PATCH] Update tools.func --- misc/tools.func | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/misc/tools.func b/misc/tools.func index 21a88507..be3cc07b 100644 --- a/misc/tools.func +++ b/misc/tools.func @@ -299,11 +299,20 @@ install_mysql() { if command -v mysql >/dev/null; then CURRENT_VERSION="$(mysql --version | grep -oP 'Distrib\s+\K[0-9]+\.[0-9]+')" if [[ "$CURRENT_VERSION" != "$MYSQL_VERSION" ]]; then - msg_info "MySQL $CURRENT_VERSION found, upgrading to $MYSQL_VERSION" + msg_info "MySQL $CURRENT_VERSION found, replacing with $MYSQL_VERSION" NEED_INSTALL=true + else + # Check for patch-level updates + if apt list --upgradable 2>/dev/null | grep -q '^mysql-server/'; then + msg_info "MySQL $CURRENT_VERSION available for upgrade" + $STD apt-get update + $STD apt-get install --only-upgrade -y mysql-server + msg_ok "MySQL upgraded" + fi + return fi else - msg_info "Setup MySQL $MYSQL_VERSION" + msg_info "Installing MySQL $MYSQL_VERSION" NEED_INSTALL=true fi