From 992b4e9e17407b26ad9cf834b4a0e9ab116684d4 Mon Sep 17 00:00:00 2001 From: Developer Date: Fri, 20 Mar 2026 00:31:18 -0400 Subject: [PATCH] Add PostgreSQL and Percona Server detection - Add PostgreSQL detection via psql command * Detects version from psql --version * Sets SYS_DB_TYPE="postgresql" - Add Percona Server detection as MySQL variant * Checks for 'Percona' in mysql --version output * Sets SYS_DB_TYPE="percona" * Distinguishes from standard MySQL and MariaDB Impact: Toolkit now supports three database types: - MySQL (traditional) - MariaDB (drop-in replacement) - Percona Server (high-performance variant) - PostgreSQL (RDBMS alternative) Makes toolkit compatible with broader range of server configurations. --- lib/system-detect.sh | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/lib/system-detect.sh b/lib/system-detect.sh index f9d5103..18c8aa9 100755 --- a/lib/system-detect.sh +++ b/lib/system-detect.sh @@ -203,6 +203,7 @@ detect_web_server() { detect_database() { [ -n "$SYS_DETECTION_COMPLETE" ] || print_info "Detecting database server..." + # Check for MySQL/MariaDB/Percona if command_exists mysql; then local version_output=$(mysql --version 2>/dev/null) @@ -210,6 +211,10 @@ detect_database() { SYS_DB_TYPE="mariadb" SYS_DB_VERSION=$(echo "$version_output" | grep -oP '\d+\.\d+\.\d+' | head -1) print_success "Detected MariaDB ${SYS_DB_VERSION}" + elif echo "$version_output" | grep -qi "percona"; then + SYS_DB_TYPE="percona" + SYS_DB_VERSION=$(echo "$version_output" | grep -oP '\d+\.\d+\.\d+' | head -1) + print_success "Detected Percona Server ${SYS_DB_VERSION}" else SYS_DB_TYPE="mysql" SYS_DB_VERSION=$(echo "$version_output" | grep -oP '\d+\.\d+\.\d+' | head -1) @@ -218,8 +223,17 @@ detect_database() { return 0 fi + # Check for PostgreSQL + if command_exists psql; then + local version_output=$(psql --version 2>/dev/null) + SYS_DB_TYPE="postgresql" + SYS_DB_VERSION=$(echo "$version_output" | grep -oP '\d+\.\d+' | head -1) + print_success "Detected PostgreSQL ${SYS_DB_VERSION}" + return 0 + fi + SYS_DB_TYPE="none" - print_warning "No MySQL/MariaDB detected" + print_warning "No MySQL/MariaDB/PostgreSQL detected" return 1 }