Merge pull request #548 from Vinfall/master

Slightly improve setup script
This commit is contained in:
Bui 2022-10-24 19:08:36 +01:00 committed by GitHub
commit c9945209ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7,14 +7,18 @@ sudo apt install -y git python3-pip python3-virtualenv python3-venv nginx ffmpeg
if [[ -r /etc/os-release ]]; then if [[ -r /etc/os-release ]]; then
. /etc/os-release . /etc/os-release
if [[ $ID = ubuntu ]]; then if [[ $ID = ubuntu ]]; then
if [[ $VERSION_CODENAME = impish ]]; then # MongoDB supports only LTS and has not released package for Ubuntu 22.04 LTS yet
VERSION_CODENAME=focal # MongoDB does not provide packages for Ubuntu 21.10 case $VERSION_CODENAME in
fi impish|kinetic|jammy)
VERSION_CODENAME=focal ;;
esac
REPO="https://repo.mongodb.org/apt/ubuntu $VERSION_CODENAME/mongodb-org/5.0 multiverse" REPO="https://repo.mongodb.org/apt/ubuntu $VERSION_CODENAME/mongodb-org/5.0 multiverse"
elif [[ $ID = debian ]]; then elif [[ $ID = debian ]]; then
if [[ $VERSION_CODENAME = bullseye ]]; then # MongoDB does not provide packages for Debian 11 yet
VERSION_CODENAME=buster # MongoDB does not provide packages for Debian 11 yet case $VERSION_CODENAME in
fi bullseye|bookworm|sid)
VERSION_CODENAME=buster ;;
esac
REPO="https://repo.mongodb.org/apt/debian $VERSION_CODENAME/mongodb-org/5.0 main" REPO="https://repo.mongodb.org/apt/debian $VERSION_CODENAME/mongodb-org/5.0 main"
else else
echo "Unsupported distribution $ID" echo "Unsupported distribution $ID"
@ -25,7 +29,7 @@ else
exit 1 exit 1
fi fi
wget -qO - https://www.mongodb.org/static/pgp/server-5.0.asc | sudo apt-key add - wget -qO - https://www.mongodb.org/static/pgp/server-5.0.asc | sudo tee /etc/apt/trusted.gpg.d/mongodb-server-5.0.asc
echo "deb [ arch=amd64,arm64 ] $REPO" | sudo tee /etc/apt/sources.list.d/mongodb-org-5.0.list echo "deb [ arch=amd64,arm64 ] $REPO" | sudo tee /etc/apt/sources.list.d/mongodb-org-5.0.list
sudo apt update sudo apt update