--- /dev/null
+pool=cyclo_forum
+sudo adduser php_"$pool" www-"$site"
+sudo adduser php_"$pool" postgres-data
+sudo adduser www-"$site"-tls www-"$site"
+"$tool"/local/postgresql-user-create "$pool"
+if test ! "$pool" = "$(sudo -u postgres psql -AqtX -c \
+ "SELECT datname
+ FROM pg_catalog.pg_database
+ WHERE datname = '$pool'
+ LIMIT 1;")"
+ then
+ "$tool"/local/postgresql-database-create "$pool"
+ sudo -u postgres psql "$pool" -AqtX --set ON_ERROR_STOP=1 \
+ -f /usr/share/phpbb3/dbconfig-common/data/phpbb3/install/pgsql
+ #-f /usr/share/phpbb3/install/schemas/postgres_schema.sql
+ fi
+"$tool"/local/postgresql-schema-create "$pool"
+sudo -u postgres psql "$pool" -AqtX --set ON_ERROR_STOP=1 <<-EOF
+ GRANT USAGE ON SCHEMA pg_catalog TO $pool;
+ GRANT SELECT ON TABLE pg_proc TO $pool;
+ GRANT SELECT ON TABLE pg_database TO $pool;
+ EOF
+
+sudo install -m 640 -o root -g php_"$pool" \
+ "$tool"/etc/phpbb3/forum.cyclocoop.org.inc.php \
+ /etc/phpbb3/forum.cyclocoop.org.inc.php
+sudo install -m 664 -o root -g www-data \
+ "$tool"/etc/phpbb3/database.inc.php \
+ /etc/phpbb3/database.inc.php