diff --git a/plugins/mongodb/versions/4.4/macos.sh b/plugins/mongodb/versions/4.4/macos.sh index 38fcefb6b..65a50ef62 100644 --- a/plugins/mongodb/versions/4.4/macos.sh +++ b/plugins/mongodb/versions/4.4/macos.sh @@ -26,4 +26,27 @@ fi if [ ! -d $serverPath/mongodb/bin ];then mkdir -p $serverPath/mongodb cd $MG_DIR/mongodb-macos-x86_64-${VERSION} && cp -rf ./bin $serverPath/mongodb -fi \ No newline at end of file +fi + +#--------------- mongosh tool install ------------------ # +TOOL_VERSION=2.2.5 +TOOL_FILE_NAME=mongosh-${TOOL_VERSION}-darwin-x64 +if [ "aarch64" == ${SYS_ARCH} ];then + TOOL_FILE_NAME=mongosh-${TOOL_VERSION}-darwin-arm64 +fi + +if [ "arm64" == ${SYS_ARCH} ];then + TOOL_FILE_NAME=mongosh-${TOOL_VERSION}-darwin-arm64 +fi +TOOL_FILE_NAME_TGZ=${TOOL_FILE_NAME}.zip +if [ ! -f $MG_DIR/${TOOL_FILE_NAME_TGZ} ]; then + wget --no-check-certificate -O $MG_DIR/${TOOL_FILE_NAME_TGZ} https://downloads.mongodb.com/compass/${TOOL_FILE_NAME_TGZ} + echo "wget --no-check-certificate -O $MG_DIR/${TOOL_FILE_NAME_TGZ} https://downloads.mongodb.com/compass/${TOOL_FILE_NAME_TGZ}" +fi + +if [ ! -d $MG_DIR/${TOOL_FILE_NAME_TGZ} ];then + cd $MG_DIR && unzip ${TOOL_FILE_NAME_TGZ} +fi + +cd ${MG_DIR}/${TOOL_FILE_NAME} && cp -rf ./bin $serverPath/mongodb +cd ${MG_DIR} && rm -rf ${MG_DIR}/${TOOL_FILE_NAME} \ No newline at end of file diff --git a/plugins/mongodb/versions/5.0/macos.sh b/plugins/mongodb/versions/5.0/macos.sh index dc41a9517..078967d47 100644 --- a/plugins/mongodb/versions/5.0/macos.sh +++ b/plugins/mongodb/versions/5.0/macos.sh @@ -26,4 +26,27 @@ fi if [ ! -d $serverPath/mongodb/bin ];then mkdir -p $serverPath/mongodb cd $MG_DIR/mongodb-macos-x86_64-${VERSION} && cp -rf ./bin $serverPath/mongodb -fi \ No newline at end of file +fi + +#--------------- mongosh tool install ------------------ # +TOOL_VERSION=2.2.5 +TOOL_FILE_NAME=mongosh-${TOOL_VERSION}-darwin-x64 +if [ "aarch64" == ${SYS_ARCH} ];then + TOOL_FILE_NAME=mongosh-${TOOL_VERSION}-darwin-arm64 +fi + +if [ "arm64" == ${SYS_ARCH} ];then + TOOL_FILE_NAME=mongosh-${TOOL_VERSION}-darwin-arm64 +fi +TOOL_FILE_NAME_TGZ=${TOOL_FILE_NAME}.zip +if [ ! -f $MG_DIR/${TOOL_FILE_NAME_TGZ} ]; then + wget --no-check-certificate -O $MG_DIR/${TOOL_FILE_NAME_TGZ} https://downloads.mongodb.com/compass/${TOOL_FILE_NAME_TGZ} + echo "wget --no-check-certificate -O $MG_DIR/${TOOL_FILE_NAME_TGZ} https://downloads.mongodb.com/compass/${TOOL_FILE_NAME_TGZ}" +fi + +if [ ! -d $MG_DIR/${TOOL_FILE_NAME_TGZ} ];then + cd $MG_DIR && unzip ${TOOL_FILE_NAME_TGZ} +fi + +cd ${MG_DIR}/${TOOL_FILE_NAME} && cp -rf ./bin $serverPath/mongodb +cd ${MG_DIR} && rm -rf ${MG_DIR}/${TOOL_FILE_NAME} \ No newline at end of file diff --git a/plugins/mongodb/versions/7.0/macos.sh b/plugins/mongodb/versions/7.0/macos.sh index c8618cc55..25d7e3ec7 100644 --- a/plugins/mongodb/versions/7.0/macos.sh +++ b/plugins/mongodb/versions/7.0/macos.sh @@ -7,6 +7,7 @@ rootPath=$(dirname "$curPath") rootPath=$(dirname "$rootPath") rootPath=$(dirname "$rootPath") serverPath=$(dirname "$rootPath") +SYS_ARCH=`arch` install_tmp=${rootPath}/tmp/mw_install.pl VERSION=7.0.9 @@ -28,10 +29,28 @@ if [ ! -d $serverPath/mongodb/bin ];then cd $MG_DIR/mongodb-macos-x86_64-${VERSION} && cp -rf ./bin $serverPath/mongodb fi +# https://downloads.mongodb.com/compass/mongosh-2.2.5-darwin-x64.zip +# https://downloads.mongodb.com/compass/mongosh-2.2.5-darwin-arm64.zip +#--------------- mongosh tool install ------------------ # TOOL_VERSION=2.2.5 - -if [ ! -f $MG_DIR/mongosh-${TOOL_VERSION}-darwin-arm64.zip ]; then - wget --no-check-certificate -O $MG_DIR/mongosh-${TOOL_VERSION}-darwin-arm64.zip https://downloads.mongodb.com/compass/mongosh-${TOOL_VERSION}-darwin-arm64.zip - echo "wget --no-check-certificate -O $MG_DIR/mongosh-${TOOL_VERSION}-darwin-arm64.zip https://downloads.mongodb.com/compass/mongosh-${TOOL_VERSION}-darwin-arm64.zip" +TOOL_FILE_NAME=mongosh-${TOOL_VERSION}-darwin-x64 +if [ "aarch64" == ${SYS_ARCH} ];then + TOOL_FILE_NAME=mongosh-${TOOL_VERSION}-darwin-arm64 fi +if [ "arm64" == ${SYS_ARCH} ];then + TOOL_FILE_NAME=mongosh-${TOOL_VERSION}-darwin-arm64 +fi +TOOL_FILE_NAME_TGZ=${TOOL_FILE_NAME}.zip +if [ ! -f $MG_DIR/${TOOL_FILE_NAME_TGZ} ]; then + wget --no-check-certificate -O $MG_DIR/${TOOL_FILE_NAME_TGZ} https://downloads.mongodb.com/compass/${TOOL_FILE_NAME_TGZ} + echo "wget --no-check-certificate -O $MG_DIR/${TOOL_FILE_NAME_TGZ} https://downloads.mongodb.com/compass/${TOOL_FILE_NAME_TGZ}" +fi + +if [ ! -d $MG_DIR/${TOOL_FILE_NAME_TGZ} ];then + cd $MG_DIR && unzip ${TOOL_FILE_NAME_TGZ} +fi + +cd ${MG_DIR}/${TOOL_FILE_NAME} && cp -rf ./bin $serverPath/mongodb +cd ${MG_DIR} && rm -rf ${MG_DIR}/${TOOL_FILE_NAME} +