39 lines
1.2 KiB
Plaintext
39 lines
1.2 KiB
Plaintext
|
#!/bin/bash
|
||
|
|
||
|
# Post-installation de scodoc
|
||
|
# ici, le répertoire /opt/scodoc vient d'être installé
|
||
|
|
||
|
# On peut donc charger la config:
|
||
|
cd /opt/scodoc
|
||
|
source /opt/scodoc/tools/config.sh
|
||
|
source /opt/scodoc/tools/utils.sh
|
||
|
|
||
|
# -- Création au besoin de notre utilisateur
|
||
|
adduser --system "${SCODOC_USER}"
|
||
|
|
||
|
# -- Répertoires /opt/scodoc donné à scodoc
|
||
|
change_scodoc_file_ownership
|
||
|
# --- Création au bseoin de /opt/scodoc-data
|
||
|
set_scodoc_var_dir
|
||
|
|
||
|
# ------------ LOCALES (pour compat bad ScoDoc 7)
|
||
|
locname="en_US.UTF-8"
|
||
|
outname=$(echo ${locname//-/} | tr '[A-Z]' '[a-z]')
|
||
|
if [ "$(locale -a | grep -E -i ^${outname}$ | wc -l)" -lt 1 ]
|
||
|
then
|
||
|
echo adding $locname
|
||
|
echo "$locname ${locname##*.}" >> /etc/locale.gen
|
||
|
/usr/sbin/locale-gen --keep-existing
|
||
|
fi
|
||
|
|
||
|
SCODOC_RELEASE=$(grep SCOVERSION sco_version.py | awk '{ print substr($3, 2, length($3)-2) }')
|
||
|
SVERSION=$(curl --silent http://scodoc.iutv.univ-paris13.fr/scodoc-installmgr/version?mode=install\&release="$SCODOC_RELEASE")
|
||
|
echo "$SVERSION" > "${SCODOC_VERSION_DIR}/scodoc.sn"
|
||
|
|
||
|
# --- POSTGRESQL
|
||
|
# --- Ensure postgres user "scodoc" ($POSTGRES_USER) exists
|
||
|
init_postgres_user
|
||
|
|
||
|
# --- SYSTEMD: on a installé un fichier de service
|
||
|
systemctl daemon-reload
|