From dc460555dbc0a8dd4f3629a4983b385b40293c16 Mon Sep 17 00:00:00 2001 From: Akatsukiro Date: Mon, 19 Feb 2024 18:25:04 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=85=A8=E8=87=AA=E5=8A=A8=E5=AE=89?= =?UTF-8?q?=E8=A3=85=20=E5=AE=89=E8=A3=85=E6=95=B0=E6=8D=AE=E5=BA=93?= =?UTF-8?q?=E9=83=A8=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 42 ++++++++++++++++++++++++++++-------------- 1 file changed, 28 insertions(+), 14 deletions(-) diff --git a/install.sh b/install.sh index 9fe5696..8f6a883 100644 --- a/install.sh +++ b/install.sh @@ -199,21 +199,35 @@ install_maraidb() { dnf install ${MARIADB_PACKAGE_URL}/yum/10.6/centos/${os_version}/x86_64/mariadb-release-10.6-1.el8.noarch.rpm -y dnf install MariaDB-server MariaDB-client -y fi - read -e -r -p "是否快速配置MariaDB? [Y/n] 默认 Y(es)" input - case $input in - [yY][eE][sS] | [yY]) - echo "开始快速配置MariaDB" - mysql_secure_installation - ;; + if [[ $autoFlag == "0" ]]; then + read -e -r -p "是否快速配置MariaDB? [Y/n] 默认 Y(es)" input + case $input in + [yY][eE][sS] | [yY]) + echo "开始快速配置MariaDB" + mysql_secure_installation + ;; - [nN][oO] | [nN]) - echo "不快速配置MariaDB" - ;; - *) - echo "开始快速配置MariaDB" - mysql_secure_installation - ;; - esac + [nN][oO] | [nN]) + echo "不快速配置MariaDB" + ;; + *) + echo "开始快速配置MariaDB" + mysql_secure_installation + ;; + esac + else + PWD = "$(openssl rand -base64 32 | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)" + mysql_secure_installation <