changes to the startup
This commit is contained in:
+10
-1
@@ -6,6 +6,15 @@ cd "$SCRIPT_DIR"
|
|||||||
|
|
||||||
DOCKER_CMD=()
|
DOCKER_CMD=()
|
||||||
SECRETS_FILE="$SCRIPT_DIR/.mongo-secrets.env"
|
SECRETS_FILE="$SCRIPT_DIR/.mongo-secrets.env"
|
||||||
|
RESET_MONGO_DATA=0
|
||||||
|
|
||||||
|
for arg in "$@"; do
|
||||||
|
case "$arg" in
|
||||||
|
--reset-mongo-data|-r)
|
||||||
|
RESET_MONGO_DATA=1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
ensure_mongo_secrets() {
|
ensure_mongo_secrets() {
|
||||||
if [ -f "$SECRETS_FILE" ]; then
|
if [ -f "$SECRETS_FILE" ]; then
|
||||||
@@ -145,7 +154,7 @@ is_truthy() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
reset_mongo_data_if_requested() {
|
reset_mongo_data_if_requested() {
|
||||||
if ! is_truthy "${MONGO_RESET_DATA:-0}"; then
|
if ! is_truthy "${MONGO_RESET_DATA:-0}" && [ "$RESET_MONGO_DATA" -ne 1 ]; then
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user