roundcube/rootfs/etc/cont-init.d/00-roundcube

9 lines
326 B
Plaintext
Raw Normal View History

2016-07-13 15:07:43 +00:00
#!/usr/bin/with-contenv sh
2016-07-13 15:27:37 +00:00
PGPASSWORD=$DBPASSWORD psql -h $DBHOST -U $DBUSER -d $DBNAME -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
2016-07-13 15:27:37 +00:00
PGPASSWORD=$DBPASSWORD psql -h $DBHOST -U $DBUSER -d $DBNAME -f /var/lib/roundcube/SQL/postgres.initial.sql
2016-07-13 15:07:43 +00:00
fi