#!/usr/bin/env bash # Start PostgreSQL (conda) and Odoo. Run from project root. set -e SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" cd "$SCRIPT_DIR" PGDATA="$SCRIPT_DIR/pgdata" PGBIN="$SCRIPT_DIR/.conda-envs/odoo19/bin" # Start PostgreSQL if not running if [ ! -f "$PGDATA/postmaster.pid" ]; then if [ ! -d "$PGDATA" ]; then echo "Initializing PostgreSQL..." mkdir -p "$PGDATA" "$PGBIN/initdb" -D "$PGDATA" -U "$USER" fi echo "Starting PostgreSQL..." "$PGBIN/pg_ctl" -D "$PGDATA" -l "$PGDATA/logfile" start sleep 2 fi # Start Odoo (in foreground; use nohup or & in terminal to background) echo "Starting Odoo at http://127.0.0.1:8069 ..." exec "$SCRIPT_DIR/run.sh"