2024-05-18 16:32:33 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
2025-01-01 13:37:29 +01:00
|
|
|
# Copyright (c) 2021-2025 tteck
|
2024-05-18 16:32:33 +02:00
|
|
|
# Author: tteck (tteckster)
|
2025-03-04 17:54:20 +01:00
|
|
|
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
|
|
|
|
# Source: https://www.mongodb.com/de-de
|
2024-05-18 16:32:33 +02:00
|
|
|
|
2025-03-24 14:20:56 +01:00
|
|
|
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
2024-05-18 16:32:33 +02:00
|
|
|
color
|
|
|
|
|
verb_ip6
|
|
|
|
|
catch_errors
|
|
|
|
|
setting_up_container
|
|
|
|
|
network_check
|
|
|
|
|
update_os
|
|
|
|
|
|
2025-05-15 11:13:57 +02:00
|
|
|
read -p "${TAB3}Do you want to install MongoDB 8.0 instead of 7.0? [y/N]: " install_mongodb_8
|
2024-12-27 20:29:01 +01:00
|
|
|
if [[ "$install_mongodb_8" =~ ^[Yy]$ ]]; then
|
|
|
|
|
MONGODB_VERSION="8.0"
|
|
|
|
|
else
|
|
|
|
|
MONGODB_VERSION="7.0"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
msg_info "Installing MongoDB $MONGODB_VERSION"
|
2025-04-01 10:25:46 +02:00
|
|
|
curl -fsSL "https://www.mongodb.org/static/pgp/server-${MONGODB_VERSION}.asc" | gpg --dearmor >/usr/share/keyrings/mongodb-server-${MONGODB_VERSION}.gpg
|
2025-10-15 22:29:48 +02:00
|
|
|
cat <<EOF >/etc/apt/sources.list.d/mongodb-org-${MONGODB_VERSION}.sources
|
|
|
|
|
Types: deb
|
|
|
|
|
URIs: http://repo.mongodb.org/apt/debian
|
|
|
|
|
Suites: $(grep '^VERSION_CODENAME=' /etc/os-release | cut -d'=' -f2)/mongodb-org/${MONGODB_VERSION}
|
|
|
|
|
Components: main
|
|
|
|
|
Signed-By: /usr/share/keyrings/mongodb-server-${MONGODB_VERSION}.gpg
|
|
|
|
|
EOF
|
|
|
|
|
$STD apt update
|
|
|
|
|
$STD apt install -y mongodb-org
|
2024-05-18 19:21:25 +02:00
|
|
|
sed -i 's/bindIp: 127.0.0.1/bindIp: 0.0.0.0/' /etc/mongod.conf
|
2025-04-01 20:22:40 +02:00
|
|
|
systemctl enable -q --now mongod
|
2024-12-27 20:29:01 +01:00
|
|
|
msg_ok "Installed MongoDB $MONGODB_VERSION"
|
2024-05-18 16:32:33 +02:00
|
|
|
|
|
|
|
|
motd_ssh
|
|
|
|
|
customize
|
|
|
|
|
|
|
|
|
|
msg_info "Cleaning up"
|
2025-10-15 22:29:48 +02:00
|
|
|
$STD apt -y autoremove
|
|
|
|
|
$STD apt -y autoclean
|
|
|
|
|
$STD apt -y clean
|
2024-05-18 16:32:33 +02:00
|
|
|
msg_ok "Cleaned"
|