mirror of
https://gh.llkk.cc/https://github.com/WeblateOrg/scripts.git
synced 2025-10-03 15:01:00 +08:00
23 lines
529 B
Bash
Executable file
23 lines
529 B
Bash
Executable file
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
# shellcheck disable=SC1091
|
|
. /etc/weblate-bootstrap
|
|
|
|
cd /tmp
|
|
|
|
# Install postgresql
|
|
apt install -y postgresql
|
|
|
|
# Figure out current cluster version
|
|
# shellcheck disable=SC2012
|
|
CLUSTER_VERSION=$(ls /etc/postgresql | sort | tail -n1)
|
|
|
|
# Start cluster
|
|
pg_ctlcluster "$CLUSTER_VERSION" main start
|
|
|
|
# Create Weblate user and database
|
|
sudo -u postgres createuser --superuser weblate
|
|
sudo -u postgres createdb -O weblate weblate
|
|
sudo -u postgres psql -c "alter user weblate with encrypted password '$POSTGRES_PASS';"
|