diff --git a/plugins/mongodb/versions/4.4/debian.sh b/plugins/mongodb/versions/4.4/debian.sh index 0d181514a..3f54204af 100644 --- a/plugins/mongodb/versions/4.4/debian.sh +++ b/plugins/mongodb/versions/4.4/debian.sh @@ -9,20 +9,35 @@ serverPath=$(dirname "$rootPath") install_tmp=${rootPath}/tmp/mw_install.pl VERSION=4.4.23 +SYS_ARCH=`arch` +SYS_VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}'` +SYS_NAME=${SYS_VERSION_ID/./} + +if [ "$SYS_NAME" -gt "10" ];then + SYS_NAME="10" +fi + +if [ "$SYS_NAME" -lt "10" ];then + SYS_NAME="10" +fi + +FILE_NAME=mongodb-linux-${SYS_ARCH}-debian${SYS_NAME}-${VERSION} +FILE_NAME_TGZ=${FILE_NAME}.tgz + MG_DIR=$serverPath/source/mongodb mkdir -p $MG_DIR -if [ ! -f $MG_DIR/mongodb-linux-x86_64-debian10-${VERSION}.tgz ]; then - wget --no-check-certificate -O $MG_DIR/mongodb-linux-x86_64-debian10-${VERSION}.tgz https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-debian10-${VERSION}.tgz - echo "wget --no-check-certificate -O $MG_DIR/mongodb-linux-x86_64-debian10-${VERSION}.tgz https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-debian10-${VERSION}.tgz" +if [ ! -f $MG_DIR/${FILE_NAME_TGZ} ]; then + wget --no-check-certificate -O $MG_DIR/${FILE_NAME_TGZ} https://fastdl.mongodb.org/linux/${FILE_NAME_TGZ} + echo "wget --no-check-certificate -O $MG_DIR/${FILE_NAME_TGZ} https://fastdl.mongodb.org/linux/${FILE_NAME_TGZ}" fi -if [ ! -d $MG_DIR/mongodb-linux-x86_64-debian10-${VERSION} ];then - cd $MG_DIR && tar -zxvf mongodb-linux-x86_64-debian10-${VERSION}.tgz +if [ ! -d $MG_DIR/${FILE_NAME_TGZ} ];then + cd $MG_DIR && tar -zxvf ${FILE_NAME_TGZ} fi if [ ! -d $serverPath/mongodb/bin ];then mkdir -p $serverPath/mongodb - cd $MG_DIR/mongodb-linux-x86_64-debian10-${VERSION} && cp -rf ./bin $serverPath/mongodb + cd $MG_DIR/${FILE_NAME}} && cp -rf ./bin $serverPath/mongodb fi \ No newline at end of file diff --git a/plugins/mongodb/versions/5.0/debian.sh b/plugins/mongodb/versions/5.0/debian.sh index 9960c2da5..ea7f30b33 100644 --- a/plugins/mongodb/versions/5.0/debian.sh +++ b/plugins/mongodb/versions/5.0/debian.sh @@ -9,20 +9,35 @@ serverPath=$(dirname "$rootPath") install_tmp=${rootPath}/tmp/mw_install.pl VERSION=5.0.20 +SYS_ARCH=`arch` +SYS_VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}'` +SYS_NAME=${SYS_VERSION_ID/./} + +if [ "$SYS_NAME" -gt "11" ];then + SYS_NAME="11" +fi + +if [ "$SYS_NAME" -lt "10" ];then + SYS_NAME="10" +fi + +FILE_NAME=mongodb-linux-${SYS_ARCH}-debian${SYS_NAME}-${VERSION} +FILE_NAME_TGZ=${FILE_NAME}.tgz + MG_DIR=$serverPath/source/mongodb mkdir -p $MG_DIR -if [ ! -f $MG_DIR/mongodb-linux-x86_64-debian11-${VERSION}.tgz ]; then - wget --no-check-certificate -O $MG_DIR/mongodb-linux-x86_64-debian11-${VERSION}.tgz https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-debian11-${VERSION}.tgz - echo "wget --no-check-certificate -O mongodb-linux-x86_64-debian11-${VERSION}.tgz https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-debian11-${VERSION}.tgz" +if [ ! -f $MG_DIR/${FILE_NAME_TGZ} ]; then + wget --no-check-certificate -O $MG_DIR/${FILE_NAME_TGZ} https://fastdl.mongodb.org/linux/${FILE_NAME_TGZ} + echo "wget --no-check-certificate -O $MG_DIR/${FILE_NAME_TGZ} https://fastdl.mongodb.org/linux/${FILE_NAME_TGZ}" fi -if [ ! -d $MG_DIR/mongodb-linux-x86_64-debian11-${VERSION} ];then - cd $MG_DIR && tar -zxvf mongodb-linux-x86_64-debian11-${VERSION}.tgz +if [ ! -d $MG_DIR/${FILE_NAME_TGZ} ];then + cd $MG_DIR && tar -zxvf ${FILE_NAME_TGZ} fi if [ ! -d $serverPath/mongodb/bin ];then mkdir -p $serverPath/mongodb - cd $MG_DIR/mongodb-linux-x86_64-debian11-${VERSION} && cp -rf ./bin $serverPath/mongodb + cd $MG_DIR/${FILE_NAME}} && cp -rf ./bin $serverPath/mongodb fi \ No newline at end of file diff --git a/plugins/mongodb/versions/6.0/debian.sh b/plugins/mongodb/versions/6.0/debian.sh index 191052004..503aeadba 100644 --- a/plugins/mongodb/versions/6.0/debian.sh +++ b/plugins/mongodb/versions/6.0/debian.sh @@ -9,20 +9,35 @@ serverPath=$(dirname "$rootPath") install_tmp=${rootPath}/tmp/mw_install.pl VERSION=6.0.9 +SYS_ARCH=`arch` +SYS_VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}'` +SYS_NAME=${SYS_VERSION_ID/./} + +if [ "$SYS_NAME" -gt "11" ];then + SYS_NAME="11" +fi + +if [ "$SYS_NAME" -lt "10" ];then + SYS_NAME="10" +fi + +FILE_NAME=mongodb-linux-${SYS_ARCH}-debian${SYS_NAME}-${VERSION} +FILE_NAME_TGZ=${FILE_NAME}.tgz + MG_DIR=$serverPath/source/mongodb mkdir -p $MG_DIR -if [ ! -f $MG_DIR/mongodb-linux-x86_64-debian11-${VERSION}.tgz ]; then - wget --no-check-certificate -O $MG_DIR/mongodb-linux-x86_64-debian11-${VERSION}.tgz https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-debian11-${VERSION}.tgz - echo "wget --no-check-certificate -O mongodb-linux-x86_64-debian11-${VERSION}.tgz https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-debian11-${VERSION}.tgz" +if [ ! -f $MG_DIR/${FILE_NAME_TGZ} ]; then + wget --no-check-certificate -O $MG_DIR/${FILE_NAME_TGZ} https://fastdl.mongodb.org/linux/${FILE_NAME_TGZ} + echo "wget --no-check-certificate -O $MG_DIR/${FILE_NAME_TGZ} https://fastdl.mongodb.org/linux/${FILE_NAME_TGZ}" fi -if [ ! -d $MG_DIR/mongodb-linux-x86_64-debian11-${VERSION} ];then - cd $MG_DIR && tar -zxvf mongodb-linux-x86_64-debian11-${VERSION}.tgz +if [ ! -d $MG_DIR/${FILE_NAME_TGZ} ];then + cd $MG_DIR && tar -zxvf ${FILE_NAME_TGZ} fi if [ ! -d $serverPath/mongodb/bin ];then mkdir -p $serverPath/mongodb - cd $MG_DIR/mongodb-linux-x86_64-debian11-${VERSION} && cp -rf ./bin $serverPath/mongodb + cd $MG_DIR/${FILE_NAME}} && cp -rf ./bin $serverPath/mongodb fi \ No newline at end of file diff --git a/plugins/mongodb/versions/7.0/debian.sh b/plugins/mongodb/versions/7.0/debian.sh index eab8a4a5f..2e08318d3 100644 --- a/plugins/mongodb/versions/7.0/debian.sh +++ b/plugins/mongodb/versions/7.0/debian.sh @@ -9,20 +9,35 @@ serverPath=$(dirname "$rootPath") install_tmp=${rootPath}/tmp/mw_install.pl VERSION=7.0.0 +SYS_ARCH=`arch` +SYS_VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}'` +SYS_NAME=${SYS_VERSION_ID/./} + +if [ "$SYS_NAME" -gt "11" ];then + SYS_NAME="11" +fi + +if [ "$SYS_NAME" -lt "11" ];then + SYS_NAME="11" +fi + +FILE_NAME=mongodb-linux-${SYS_ARCH}-debian${SYS_NAME}-${VERSION} +FILE_NAME_TGZ=${FILE_NAME}.tgz + MG_DIR=$serverPath/source/mongodb mkdir -p $MG_DIR -if [ ! -f $MG_DIR/mongodb-linux-x86_64-debian11-${VERSION}.tgz ]; then - wget --no-check-certificate -O $MG_DIR/mongodb-linux-x86_64-debian11-${VERSION}.tgz https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-debian11-${VERSION}.tgz - echo "wget --no-check-certificate -O mongodb-linux-x86_64-debian11-${VERSION}.tgz https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-debian11-${VERSION}.tgz" +if [ ! -f $MG_DIR/${FILE_NAME_TGZ} ]; then + wget --no-check-certificate -O $MG_DIR/${FILE_NAME_TGZ} https://fastdl.mongodb.org/linux/${FILE_NAME_TGZ} + echo "wget --no-check-certificate -O $MG_DIR/${FILE_NAME_TGZ} https://fastdl.mongodb.org/linux/${FILE_NAME_TGZ}" fi -if [ ! -d $MG_DIR/mongodb-linux-x86_64-debian11-${VERSION} ];then - cd $MG_DIR && tar -zxvf mongodb-linux-x86_64-debian11-${VERSION}.tgz +if [ ! -d $MG_DIR/${FILE_NAME_TGZ} ];then + cd $MG_DIR && tar -zxvf ${FILE_NAME_TGZ} fi if [ ! -d $serverPath/mongodb/bin ];then mkdir -p $serverPath/mongodb - cd $MG_DIR/mongodb-linux-x86_64-debian11-${VERSION} && cp -rf ./bin $serverPath/mongodb + cd $MG_DIR/${FILE_NAME}} && cp -rf ./bin $serverPath/mongodb fi \ No newline at end of file