diff --git a/plugins/mysql-ya/index.py b/plugins/mysql-ya/index.py index af9824300..89cfaaa5e 100755 --- a/plugins/mysql-ya/index.py +++ b/plugins/mysql-ya/index.py @@ -1798,6 +1798,7 @@ def installPreInspection(version): sys_id = mw.execShell( "cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F '\"' '{print $2}'") + print(sys, sys_id) return 'ok' if __name__ == "__main__": diff --git a/plugins/mysql-ya/install.sh b/plugins/mysql-ya/install.sh index 39d37f059..75a054155 100755 --- a/plugins/mysql-ya/install.sh +++ b/plugins/mysql-ya/install.sh @@ -29,6 +29,11 @@ if [ ! -d $curPath/versions/$2 ];then exit 0 fi +if [ "${action}" == "uninstall" ];then + + cd ${rootPath} && python3 ${rootPath}/plugins/mysql-ya/index.py stop ${type} + cd ${rootPath} && python3 ${rootPath}/plugins/mysql-ya/index.py initd_uninstall ${type} +fi sh -x $curPath/versions/$2/install.sh $1 diff --git a/plugins/mysql-ya/versions/5.7/install.sh b/plugins/mysql-ya/versions/5.7/install.sh index 8e2d5622c..a601dfa10 100755 --- a/plugins/mysql-ya/versions/5.7/install.sh +++ b/plugins/mysql-ya/versions/5.7/install.sh @@ -54,11 +54,11 @@ YUM_INSTALL() ####### #http://repo.mysql.com/ -if [ "${OSNAME}" == "centos" ] && [ "${VERSION_ID}" -eq "7" ] ;then - wget -O /tmp/mysql57-community-release-el7.rpm http://repo.mysql.com/mysql57-community-release-el7.rpm - rpm -ivh /tmp/mysql57-community-release-el7.rpm +if [ "${OSNAME}" == "centos" ] && [ "${VERSION_ID}" -lt "7" ] ;then + wget -O /tmp/mysql57-community-release-el${VERSION_ID}.rpm http://repo.mysql.com/mysql57-community-release-el${VERSION_ID}.rpm + rpm -ivh /tmp/mysql57-community-release-el${VERSION_ID}.rpm yum -y install mysql-server - rm -rf /tmp/mysql57-community-release-el7.rpm + rm -rf /tmp/mysql57-community-release-el${VERSION_ID}.rpm fi ####### }