roundcube/rootfs/bin/dbinit

9 lines
334 B
Plaintext
Raw Normal View History

2016-07-13 15:07:43 +00:00
#!/usr/bin/with-contenv sh
2017-10-06 09:57:54 +00:00
PGPASSWORD=$DB_PASSWORD psql -h $DB_HOST -U $DB_USER -d $DB_NAME -c "SELECT EXISTS (SELECT 1 FROM information_schema.tables WHERE table_name = 'session')" | grep f
2016-07-13 15:07:43 +00:00
if [ $? -ne 1 ]; then
2017-10-06 09:57:54 +00:00
PGPASSWORD=$DB_PASSWORD psql -h $DB_HOST -U $DB_USER -d $DB_NAME -f /var/lib/roundcube/SQL/postgres.initial.sql
2016-07-13 15:07:43 +00:00
fi