Split startup into its own script to run it only in production.
Repeateadly start the index script in production to avoid the mongo connection problem and others related.
Add lint options to bash scripts.