Ajout : letabli.cyclocoop.org.
[lhc/ateliers.git] / etc / nginx / site.d / cyclo-letabli / local.sh
1 pool=cyclo_letabli
2 sudo adduser php_"$pool" www-"$site"
3 sudo adduser www-"$site" sftp
4
5 sudo rmdir ~www-data/"$site" || true
6 sudo install -d -m 2750 -o root -g www-"$site" \
7 ~www-data/"$site"
8 sudo install -d -m 2750 -o www-"$site" -g www-"$site" \
9 ~www-data/"$site"/etc \
10 ~www-data/"$site"/etc/ssh
11 sudo install -d -m 2770 -o www-"$site" -g www-"$site" \
12 ~www-data/"$site"/www
13
14 "$tool"/local/runit-sv-configure postgres
15 "$tool"/local/runit-sv-start postgres
16 while ! sudo -u postgres psql </dev/null
17 do sleep 1; done
18
19 "$tool"/local/postgresql-user-create "$pool"
20 "$tool"/local/postgresql-database-create "$pool"
21 "$tool"/local/postgresql-schema-create "$pool"
22 sudo -u postgres psql -AqtX --set ON_ERROR_STOP=1 "$pool" <<-EOF
23 GRANT USAGE ON SCHEMA pg_catalog TO $pool;
24 EOF