#!/bin/bash source ../venv/bin/activate source ./config.sh #### Security # Set to production mode and auth level for demos export OTREE_PRODUCTION=1 export OTREE_AUTH_LEVEL=STUDY _term() { echo "" echo "---------------- Stopping Server ------------------" echo "" echo "" kill -TERM "$CPID" 2>/dev/null } trap _term SIGTERM while true; do echo "" echo "---------------- Starting Server -------------" echo "" echo "" otree runprodserver --addr 0.0.0.0 --port $PORT 2>&1 | tee -a otree.log & CPID=$! wait $CPID echo "" echo "------------ Server Stopped: Restarting ------" echo "" sleep 30 done