This commit is contained in:
oliver committed 2026-10-15 18:52:10 -03:00
1 parent 10f0422155
commit de583713da
2 files changed
-39

No files matched your search

-38
View File
@@ -1,38 +0,0 @@
#!/bin/bash
# Usage: odoo <UUID> [odoo args...]
# Example: odoo 001-003-abcdef -u my_custom_module --stop-after-init
#
# Thin wrapper around `docker exec <UUID> odoo` that injects the database login
# parameters (database, host, port, user, password) so callers only pass the
# Odoo CLI options they care about.
if [ -z "$1" ]; then
echo "Usage: $0 <UUID> [odoo args...]"
exit 1
fi
UUID="$1"
shift
source /4server/sbin/helpers
get_contract_info
# The container talks to the shared Postgres as its own per-UUID user.
ODOO_DB_USER="$UUID"
if ! doas docker ps --format '{{.Names}}' | grep -q "^${UUID}$"; then
echo "Error: container $UUID is not running" >&2
exit 1
fi
# Attach a TTY only when we have one, so piped/non-interactive use still works.
DOCKER_TTY=""
[ -t 0 ] && DOCKER_TTY="-it"
doas docker exec $DOCKER_TTY -u odoo "$UUID" odoo \
-d "$UUID" \
--db_host="$POSTGRES_HOST" \
--db_port="$POSTGRES_PORT" \
--db_user="$ODOO_DB_USER" \
--db_password="$ODOO_DB_PASSWORD" \
"$@"
-1
View File
@@ -19,4 +19,3 @@ rex doas ln -sf /4server/sbin/activeContainers /usr/bin/
rex doas ln -sf /4server/sbin/startContainer /usr/bin/ rex doas ln -sf /4server/sbin/startContainer /usr/bin/
rex doas ln -sf /4server/sbin/restartContainers /usr/bin/ rex doas ln -sf /4server/sbin/restartContainers /usr/bin/
rex doas ln -sf /4server/sbin/checkBackup /usr/bin/ rex doas ln -sf /4server/sbin/checkBackup /usr/bin/
rex doas ln -sf /4server/sbin/odoo /usr/bin/