#!/bin/bash if [ -f {{ mongodb_db_lock_file }} ]; then echo '"mongod --repair" cannot run when {{ mongodb_db_lock_file }} present.' >&2 # Output to STDERR but keep going, so /etc/systems/system/mongodb.service continues else /usr/bin/mongod --repair --dbpath {{ mongodb_db_path }} fi