This commit is contained in:
BoHung Chiu 2022-09-15 23:34:09 +08:00
parent 246f5921fd
commit 81f4f2e917
2 changed files with 13 additions and 12 deletions

View File

@ -22,7 +22,7 @@ if [[ ! -d "/usr/include/openssl" ]] && [[ ! -d "/usr/local/include/openssl" ]]
fi fi
if [[ "$openssl_ver" < "1.1.1" ]] || [[ "$force_reinstall_openssl" == "1" ]]; then if [[ "$openssl_ver" < "1.1.1" ]] || [[ "$force_reinstall_openssl" == "1" ]]; then
# Build openssl # Build openssl
target_openssl_ver="1.1.1m" target_openssl_ver="1.1.1q"
sudo bash -l -c " sudo bash -l -c "
cd /root && cd /root &&
wget https://www.openssl.org/source/openssl-$target_openssl_ver.tar.gz --no-check-certificate -O openssl-$target_openssl_ver.tar.gz && wget https://www.openssl.org/source/openssl-$target_openssl_ver.tar.gz --no-check-certificate -O openssl-$target_openssl_ver.tar.gz &&

View File

@ -86,9 +86,10 @@ if [[ $ubuntu_version > '21' ]]; then # ruby must use openssl <= 1.1.1. Not supp
make depend -j$cpu_cores && make install" make depend -j$cpu_cores && make install"
openssl_ver="$target_openssl_ver" openssl_ver="$target_openssl_ver"
cd "$org_pwd" cd "$org_pwd"
openssl_dir="/opt/openssl"
openssl_source_dir="/root/openssl-$target_openssl_ver"
fi fi
openssl_dir="/opt/openssl"
sudo rm -rf /opt/openssl/ssl/certs
sudo ln -s /etc/ssl/certs/ /opt/openssl/ssl/.
sudo mkdir -p /etc/apt/trusted.gpg.d/ sudo mkdir -p /etc/apt/trusted.gpg.d/
fi fi
cd /etc/nginx/ cd /etc/nginx/
@ -130,10 +131,10 @@ else
# install mongod 6.0 # install mongod 6.0
apt_add_key_func https://www.mongodb.org/static/pgp/server-6.0.asc apt_add_key_func https://www.mongodb.org/static/pgp/server-6.0.asc
if [[ $ubuntu_version > '20' ]]; then if [[ $ubuntu_version > '20' ]]; then
sudo wget -nc http://archive.ubuntu.com/ubuntu/pool/main/o/openssl1.0/libssl1.0-dev_1.0.2n-1ubuntu5_amd64.deb sudo wget -nc http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1-1ubuntu2.1~18.04.20_amd64.deb
sudo dpkg -i libssl1.0-dev_1.0.2n-1ubuntu5_amd64.deb sudo dpkg -i libssl1.1_1.1.1-1ubuntu2.1~18.04.20_amd64.deb
sudo wget -nc http://archive.ubuntu.com/ubuntu/pool/main/o/openssl1.0/libssl1.0.0_1.0.2n-1ubuntu5_amd64.deb sudo wget -nc http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl-dev_1.1.1-1ubuntu2.1~18.04.20_amd64.deb
sudo dpkg -i libssl1.0.0_1.0.2n-1ubuntu5_amd64.deb sudo dpkg -i libssl-dev_1.1.1-1ubuntu2.1~18.04.20_amd64.deb
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list
elif [[ $ubuntu_version =~ '18' ]] || [[ $ubuntu_version =~ '19' ]]; then elif [[ $ubuntu_version =~ '18' ]] || [[ $ubuntu_version =~ '19' ]]; then
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list
@ -166,10 +167,10 @@ else
apt_add_key_func https://www.mongodb.org/static/pgp/server-5.0.asc apt_add_key_func https://www.mongodb.org/static/pgp/server-5.0.asc
# install mongod 5.0 # install mongod 5.0
if [[ $ubuntu_version > '20' ]]; then if [[ $ubuntu_version > '20' ]]; then
sudo wget -nc http://archive.ubuntu.com/ubuntu/pool/main/o/openssl1.0/libssl1.0-dev_1.0.2n-1ubuntu5_amd64.deb sudo wget -nc http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1-1ubuntu2.1~18.04.20_amd64.deb
sudo dpkg -i libssl1.0-dev_1.0.2n-1ubuntu5_amd64.deb sudo dpkg -i libssl1.1_1.1.1-1ubuntu2.1~18.04.20_amd64.deb
sudo wget -nc http://archive.ubuntu.com/ubuntu/pool/main/o/openssl1.0/libssl1.0.0_1.0.2n-1ubuntu5_amd64.deb sudo wget -nc http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl-dev_1.1.1-1ubuntu2.1~18.04.20_amd64.deb
sudo dpkg -i libssl1.0.0_1.0.2n-1ubuntu5_amd64.deb sudo dpkg -i libssl-dev_1.1.1-1ubuntu2.1~18.04.20_amd64.deb
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/5.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-5.0.list echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/5.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-5.0.list
elif [[ $ubuntu_version =~ '18' ]] || [[ $ubuntu_version =~ '19' ]]; then elif [[ $ubuntu_version =~ '18' ]] || [[ $ubuntu_version =~ '19' ]]; then
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/5.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-5.0.list echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/5.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-5.0.list