# Shared binary/PATH setup used by both server modes. # This file is sourced and must not be executed directly. if [ ! -f ./_mongodb_os_dist_ver.bash ]; then echo "MongoDB setup files must be sourced from the extension's top-level directory." >&2 return 1 2>/dev/null || exit 1 fi . ./_mongodb_os_dist_ver.bash export GS_MONGODB_SOURCE_HOME="$PWD" if [ -z "${MONGODB_HOME:-}" ]; then export MONGODB_HOME="$GS_MONGODB_SOURCE_HOME/mongodb-$mongodb_os_dist_ver" fi if [ ! -x "$MONGODB_HOME/bin/mongod" ]; then echo "MongoDB has not been installed at:" >&2 echo " $MONGODB_HOME" >&2 echo "Run ./INSTALL.sh first, or set MONGODB_HOME before sourcing SETUP.bash." >&2 return 1 2>/dev/null || exit 1 fi case ":$PATH:" in *":$MONGODB_HOME/bin:"*) ;; *) export PATH="$MONGODB_HOME/bin:$PATH" ;; esac if [ -z "${MONGOSH_HOME:-}" ]; then export MONGOSH_HOME="$GS_MONGODB_SOURCE_HOME/mongosh-$mongosh_os_ver" fi if [ ! -x "$MONGOSH_HOME/bin/mongosh" ]; then echo "mongosh has not been installed at:" >&2 echo " $MONGOSH_HOME" >&2 echo "Run ./INSTALL.sh first, or set MONGOSH_HOME before sourcing SETUP.bash." >&2 return 1 2>/dev/null || exit 1 fi case ":$PATH:" in *":$MONGOSH_HOME/bin:"*) ;; *) export PATH="$MONGOSH_HOME/bin:$PATH" ;; esac