From 3dccb2620d9021686d66497fc223aa2c35023ba0 Mon Sep 17 00:00:00 2001 From: midoks Date: Mon, 7 Nov 2022 10:33:55 +0800 Subject: [PATCH] Update install.sh --- plugins/mysql-apt/versions/5.7/install.sh | 36 +++-------------------- 1 file changed, 4 insertions(+), 32 deletions(-) diff --git a/plugins/mysql-apt/versions/5.7/install.sh b/plugins/mysql-apt/versions/5.7/install.sh index 1a21fea31..795e98739 100755 --- a/plugins/mysql-apt/versions/5.7/install.sh +++ b/plugins/mysql-apt/versions/5.7/install.sh @@ -18,38 +18,10 @@ install_tmp=${rootPath}/tmp/mw_install.pl mysqlDir=${serverPath}/source/mysql -_os=`uname` -if [ ${_os} == "Darwin" ]; then - OSNAME='macos' -elif grep -Eqi "CentOS" /etc/issue || grep -Eq "CentOS" /etc/*-release; then - OSNAME='centos' -elif grep -Eqi "Rocky" /etc/issue || grep -Eq "Rocky" /etc/*-release; then - OSNAME='rocky' -elif grep -Eqi "Red Hat Enterprise Linux Server" /etc/issue || grep -Eq "Red Hat Enterprise Linux Server" /etc/*-release; then - OSNAME='rhel' -elif grep -Eqi "Aliyun" /etc/issue || grep -Eq "Aliyun" /etc/*-release; then - OSNAME='aliyun' -elif grep -Eqi "Fedora" /etc/issue || grep -Eq "Fedora" /etc/*-release; then - OSNAME='fedora' -elif grep -Eqi "Amazon Linux AMI" /etc/issue || grep -Eq "Amazon Linux AMI" /etc/*-release; then - OSNAME='amazon' -elif grep -Eqi "Debian" /etc/issue || grep -Eq "Debian" /etc/*-release; then - OSNAME='debian' -elif grep -Eqi "Ubuntu" /etc/issue || grep -Eq "Ubuntu" /etc/*-release; then - OSNAME='ubuntu' -elif grep -Eqi "Raspbian" /etc/issue || grep -Eq "Raspbian" /etc/*-release; then - OSNAME='raspbian' -elif grep -Eqi "Deepin" /etc/issue || grep -Eq "Deepin" /etc/*-release; then - OSNAME='deepin' -else - OSNAME='unknow' -fi - +bash ${rootPath}/scripts/getos.sh +OSNAME=`cat ${rootPath}/data/osname.pl` VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}'` - - - APT_INSTALL() { ######## @@ -77,8 +49,8 @@ Install_mysql() echo '正在安装脚本文件...' > $install_tmp if id mysql &> /dev/null ;then - echo "mysql UID is `id -u mysql`" - echo "mysql Shell is `grep "^mysql:" /etc/passwd |cut -d':' -f7 `" + echo "mysql uid is `id -u mysql`" + echo "mysql shell is `grep "^mysql:" /etc/passwd |cut -d':' -f7 `" else groupadd mysql useradd -g mysql mysql