ScoDoc-PE/config/config.sh

71 lines
1.8 KiB
Bash
Raw Permalink Normal View History

2021-01-23 17:42:14 +01:00
#!/bin/bash
2020-09-26 16:19:37 +02:00
# Version majeure de Debian (..., 9, 10)
debian_version=$(cat /etc/debian_version)
debian_version=${debian_version%%.*}
2021-01-23 17:42:14 +01:00
die() {
echo
echo "Erreur: $1"
echo
exit 1
}
2020-09-26 16:19:37 +02:00
# Fix path
export PATH="${PATH}":/usr/sbin:/sbin
# ScoDoc: environment variables
umask 0022
2020-12-06 15:28:49 +01:00
export SCODOC_DIR=/opt/scodoc/Products/ScoDoc
2021-01-23 17:42:14 +01:00
SCODOC_VAR_DIR=$(realpath -L "$SCODOC_DIR/../../var/scodoc") || die "can't set SCODOC_VAR_DIR"
export SCODOC_VAR_DIR
2020-09-26 16:19:37 +02:00
# = /opt/scodoc/var/scodoc
export SCODOC_VERSION_DIR="${SCODOC_VAR_DIR}/config/version"
export SCODOC_LOGOS_DIR="${SCODOC_VAR_DIR}/config/logos"
# Postgresql superuser:
export POSTGRES_SUPERUSER=postgres
# Postgresql normal user: (by default, same a zope==www-data)
# IMPORTANT: must match SCO_DEFAULT_SQL_USER defined in sco_utils.py
export POSTGRES_USER=www-data
# psql command: if various versions installed, force the one we want:
2021-01-23 17:42:14 +01:00
if [ "${debian_version}" = "10" ]
2020-09-26 16:19:37 +02:00
then
PSQL=/usr/lib/postgresql/11/bin/psql
export POSTGRES_SERVICE="postgresql@11-main.service"
2021-01-23 17:42:14 +01:00
elif [ "${debian_version}" = "9" ]
2020-09-26 16:19:37 +02:00
then
PSQL=/usr/lib/postgresql/9.6/bin/psql
export POSTGRES_SERVICE="postgresql"
2021-01-23 17:42:14 +01:00
elif [ "${debian_version}" = "8" ]
2020-09-26 16:19:37 +02:00
then
PSQL=/usr/lib/postgresql/9.4/bin/psql
2021-01-23 17:42:14 +01:00
elif [ "${debian_version}" = "7" ]
2020-09-26 16:19:37 +02:00
then
PSQL=/usr/lib/postgresql/9.1/bin/psql
2021-01-23 17:42:14 +01:00
elif [ "${debian_version}" = "5" ]
2020-09-26 16:19:37 +02:00
then
PSQL=/usr/lib/postgresql/8.3/bin/psql
2021-01-23 17:42:14 +01:00
elif [ "${debian_version}" = "6" ]
2020-09-26 16:19:37 +02:00
then
PSQL=/usr/lib/postgresql/8.4/bin/psql
else
PSQL=/usr/lib/postgresql/8.1/bin/psql
fi
# tcp port for SQL server (under Debian 4, 5432 or 5433 for 8.1 if 7.4 also installed !)
# Important note: if changed, you should probably also change it in
# sco_utils.py (SCO_DEFAULT_SQL_PORT).
export POSTGRES_PORT=5432
# Utilise par le script de reset du mot de passe:
2021-01-23 17:42:14 +01:00
if [ "${debian_version}" -ge "7" ]
2020-09-26 16:19:37 +02:00
then
export ZOPE_VERSION=2.13
else
export ZOPE_VERSION=2.11.0
fi