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

9 lines
326 B
Plaintext

#!/usr/bin/with-contenv sh
PGPASSWORD=$DBPASSWORD psql -h $DBHOST -U $DBUSER -d $DBNAME -c "SELECT EXISTS (SELECT 1 FROM information_schema.tables WHERE table_name = 'session')" | grep f
if [ $? -ne 1 ]; then
PGPASSWORD=$DBPASSWORD psql -h $DBHOST -U $DBUSER -d $DBNAME -f /var/lib/roundcube/SQL/postgres.initial.sql
fi