Skip to content

Commit

Permalink
Filtering databases that the user has privilege
Browse files Browse the repository at this point in the history
  • Loading branch information
danimaribeiro authored Oct 25, 2022
1 parent 0fee351 commit 73f4d32
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bin/autoupdate
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

export PGPASSWORD=$PG_PASSWORD
DATABASES=(`psql -h $PG_HOST -U $PG_USER -d postgres -c "SELECT datname FROM pg_database WHERE datistemplate = false and datname <> 'postgres';" -t -w`)
DATABASES=(`psql -h $PG_HOST -U $PG_USER -d postgres -c "SELECT datname FROM pg_database WHERE has_database_privilege('$PG_USER', datname, 'CREATE') and datistemplate = false and datname <> 'postgres';" -t -w`)

echo "Inicializando atualizacao de bases"

Expand All @@ -11,4 +11,4 @@ do
click-odoo-update -c odoo.conf -d $base --watcher-max-seconds 60
done

echo "Finalizado"
echo "Finalizado"

0 comments on commit 73f4d32

Please sign in to comment.