mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-03-08 09:48:11 +00:00
databasus: make fetch_and_deploy_from_url accept empty dir
Pass an explicit empty second argument when downloading MongoDB tools and update fetch_and_deploy_from_url to default the directory parameter to an empty string. This avoids unset/ambiguous directory handling at the call site and ensures the function has a defined directory variable even when none is provided.
This commit is contained in:
@@ -33,7 +33,7 @@ done
|
||||
# Install MongoDB Database Tools via direct .deb (no APT repo for Debian 13)
|
||||
[[ "$(get_os_info id)" == "ubuntu" ]] && MONGO_DIST="ubuntu2204" || MONGO_DIST="debian12"
|
||||
MONGO_VERSION=$(get_latest_gh_tag "mongodb/mongo-tools" "100." || echo "100.14.1")
|
||||
fetch_and_deploy_from_url "https://fastdl.mongodb.org/tools/db/mongodb-database-tools-${MONGO_DIST}-x86_64-${MONGO_VERSION}.deb"
|
||||
fetch_and_deploy_from_url "https://fastdl.mongodb.org/tools/db/mongodb-database-tools-${MONGO_DIST}-x86_64-${MONGO_VERSION}.deb" ""
|
||||
mkdir -p /usr/local/mongodb-database-tools/bin
|
||||
[[ -f /usr/bin/mongodump ]] && ln -sf /usr/bin/mongodump /usr/local/mongodb-database-tools/bin/mongodump
|
||||
[[ -f /usr/bin/mongorestore ]] && ln -sf /usr/bin/mongorestore /usr/local/mongodb-database-tools/bin/mongorestore
|
||||
|
||||
@@ -7999,7 +7999,7 @@ EOF
|
||||
# ------------------------------------------------------------------------------
|
||||
function fetch_and_deploy_from_url() {
|
||||
local url="$1"
|
||||
local directory="$2"
|
||||
local directory="${2:-}"
|
||||
|
||||
if [[ -z "$url" ]]; then
|
||||
msg_error "URL parameter is required"
|
||||
|
||||
Reference in New Issue
Block a user