From 277737efd7b5608668120fada2639933c4e1589d Mon Sep 17 00:00:00 2001 From: midoks Date: Thu, 14 Jul 2022 20:14:08 +0800 Subject: [PATCH] up --- plugins/mysql/lib/rpcgen.sh | 29 +++++++++++++++++++++++++++ plugins/mysql/versions/5.7/install.sh | 3 ++- plugins/mysql/versions/8.0/install.sh | 4 +++- 3 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 plugins/mysql/lib/rpcgen.sh diff --git a/plugins/mysql/lib/rpcgen.sh b/plugins/mysql/lib/rpcgen.sh new file mode 100644 index 000000000..b00af73c2 --- /dev/null +++ b/plugins/mysql/lib/rpcgen.sh @@ -0,0 +1,29 @@ +#!/bin/bash +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin +export PATH + +curPath=`pwd` +rootPath=$(dirname "$curPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") + +# echo $rootPath + +SERVER_ROOT=$rootPath/lib +SOURCE_ROOT=$rootPath/source/lib + +which rpcgen +if [ "$?" != "0" ];then + + if [ ! -f ${SOURCE_ROOT}/rpcsvc-proto-1.4.tar.gz ];then + wget -O ${SOURCE_ROOT}/rpcsvc-proto-1.4.tar.gz https://github.com/thkukuk/rpcsvc-proto/releases/download/v1.4/rpcsvc-proto-1.4.tar.gz + fi + + if [ ! -d ${SERVER_ROOT}/rpcsvc-proto-1.4 ];then + cd ${SOURCE_ROOT} && tar -zxvf rpcsvc-proto-1.4.tar.gz + cd ${SOURCE_ROOT}/rpcsvc-proto-1.4 + ./configure && make && make install + fi + +fi \ No newline at end of file diff --git a/plugins/mysql/versions/5.7/install.sh b/plugins/mysql/versions/5.7/install.sh index 577aa572a..85629889e 100755 --- a/plugins/mysql/versions/5.7/install.sh +++ b/plugins/mysql/versions/5.7/install.sh @@ -38,6 +38,7 @@ Install_mysql() touch /var/log/mariadb/mariadb.log fi + cd $serverPath/mdserver-web/plugins/mysql/lib && /bin/bash rpcgen.sh if [ ! -f ${mysqlDir}/mysql-boost-${VERSION}.tar.gz ];then wget -O ${mysqlDir}/mysql-boost-${VERSION}.tar.gz --tries=3 https://cdn.mysql.com/Downloads/MySQL-5.7/mysql-boost-${VERSION}.tar.gz @@ -95,7 +96,7 @@ Install_mysql() echo '5.7' > $serverPath/mysql/version.pl echo '安装完成' > $install_tmp else - rm -rf ${mysqlDir}/mysql-${VERSION} + # rm -rf ${mysqlDir}/mysql-${VERSION} echo '安装失败' > $install_tmp echo 'install fail'>&2 exit 1 diff --git a/plugins/mysql/versions/8.0/install.sh b/plugins/mysql/versions/8.0/install.sh index 038469b89..acd58a003 100755 --- a/plugins/mysql/versions/8.0/install.sh +++ b/plugins/mysql/versions/8.0/install.sh @@ -75,6 +75,8 @@ Install_mysql() useradd -g mysql mysql fi + cd $serverPath/mdserver-web/plugins/mysql/lib && /bin/bash rpcgen.sh + INSTALL_CMD=cmake # check cmake version CMAKE_VERSION=`cmake -version | grep version | awk '{print $3}' | awk -F '.' '{print $1}'` @@ -154,7 +156,7 @@ Install_mysql() echo '8.0' > $serverPath/mysql/version.pl echo '安装完成' > $install_tmp else - rm -rf ${mysqlDir}/mysql-${VERSION} + # rm -rf ${mysqlDir}/mysql-${VERSION} echo '安装失败' > $install_tmp echo 'install fail'>&2 exit 1