#!/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