Simple Linux Panel
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mdserver-web/plugins/mongodb/versions/7.0/macos.sh

81 lines
2.9 KiB

2 years ago
#!/bin/bash
2 years ago
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin:/opt/homebrew/bin
2 years ago
export PATH
curPath=`pwd`
rootPath=$(dirname "$curPath")
rootPath=$(dirname "$rootPath")
2 years ago
rootPath=$(dirname "$rootPath")
2 years ago
serverPath=$(dirname "$rootPath")
1 year ago
SYS_ARCH=`arch`
2 years ago
install_tmp=${rootPath}/tmp/mw_install.pl
7 months ago
VERSION=7.0.14
2 years ago
MG_DIR=$serverPath/source/mongodb
mkdir -p $MG_DIR
if [ ! -f $MG_DIR/mongodb-macos-x86_64-${VERSION}.tgz ]; then
wget --no-check-certificate -O $MG_DIR/mongodb-macos-x86_64-${VERSION}.tgz https://fastdl.mongodb.org/osx/mongodb-macos-x86_64-${VERSION}.tgz
echo "wget --no-check-certificate -O $MG_DIR/mongodb-macos-x86_64-${VERSION}.tgz https://fastdl.mongodb.org/osx/mongodb-macos-x86_64-${VERSION}.tgz"
fi
if [ ! -d $MG_DIR/mongodb-macos-x86_64-${VERSION} ];then
cd $MG_DIR && tar -zxvf mongodb-macos-x86_64-${VERSION}.tgz
fi
2 years ago
if [ ! -d $serverPath/mongodb/bin ];then
2 years ago
mkdir -p $serverPath/mongodb
cd $MG_DIR/mongodb-macos-x86_64-${VERSION} && cp -rf ./bin $serverPath/mongodb
1 year ago
fi
1 year ago
# 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 ------------------ #
1 year ago
TOOL_VERSION=2.2.5
1 year ago
TOOL_FILE_NAME=mongosh-${TOOL_VERSION}-darwin-x64
if [ "aarch64" == ${SYS_ARCH} ];then
TOOL_FILE_NAME=mongosh-${TOOL_VERSION}-darwin-arm64
fi
1 year ago
1 year ago
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}"
1 year ago
fi
1 year ago
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}
1 year ago
# https://fastdl.mongodb.org/tools/db/mongodb-database-tools-macos-arm64-100.9.4.zip
TOOL_VERSION=100.9.4
TOOL_FILE_NAME=mongodb-database-tools-macos-x86_64-${TOOL_VERSION}
if [ "aarch64" == ${SYS_ARCH} ];then
TOOL_FILE_NAME=mongodb-database-tools-macos-arm64-${TOOL_VERSION}
fi
if [ "arm64" == ${SYS_ARCH} ];then
TOOL_FILE_NAME=mongodb-database-tools-macos-arm64-${TOOL_VERSION}
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://fastdl.mongodb.org/tools/db/${TOOL_FILE_NAME_TGZ}
echo "wget --no-check-certificate -O $MG_DIR/${TOOL_FILE_NAME_TGZ} https://fastdl.mongodb.org/tools/db/${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}