tools.func: fix mongodb version check, leading "v" never stripped
is_tool_installed parsed `mongod --version` ("db version v8.0.15") into
"v8.0" because the leading v was left in place. It never equals the target
"8.0", so setup_mongodb always took the clean-upgrade path and purged
mongodb-org on every run. On Omada that also drags omadac out as a
reverse-dependency, wiping the controller.
Strip the v like the node and go branches already do, so an unchanged
version compares equal and setup_mongodb just updates in place.
This commit is contained in:
1 parent
1660ce4939
commit
9276663146
1 file changed
+1
-1
+1
-1
@@ -632,7 +632,7 @@ is_tool_installed() {
|
|||||||
;;
|
;;
|
||||||
mongodb | mongod)
|
mongodb | mongod)
|
||||||
if command -v mongod >/dev/null 2>&1; then
|
if command -v mongod >/dev/null 2>&1; then
|
||||||
installed_version=$(mongod --version 2>/dev/null | awk '/db version/{print $3}' | cut -d. -f1,2)
|
installed_version=$(mongod --version 2>/dev/null | awk '/db version/{print $3}' | sed 's/^v//' | cut -d. -f1,2)
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
node | nodejs)
|
node | nodejs)
|
||||||
|
|||||||
Reference in new issue
Block a user