forked from ScoDoc/DocScoDoc
améliore check_create_scodoc_user pour set -e (contrib JMP)
This commit is contained in:
parent
e8c20f7005
commit
027237c1c6
@ -38,7 +38,7 @@ export SCODOC_DB_TEST="SCODOC_TEST"
|
||||
|
||||
|
||||
# psql command: if various versions installed, force the one we want:
|
||||
if [ "${debian_version}" = "10" ]
|
||||
if [ "${debian_version}" = "11" ]
|
||||
then
|
||||
PSQL=/usr/lib/postgresql/11/bin/psql
|
||||
export POSTGRES_SERVICE="postgresql@11-main.service"
|
||||
|
@ -21,7 +21,7 @@ check_uid_root "$0"
|
||||
cd "$SCODOC_DIR" || die "can't cd $SCODOC_DIR"
|
||||
|
||||
# ------------ Safety checks
|
||||
if [ "${debian_version}" != "10" ]
|
||||
if [ "${debian_version}" != "11" ]
|
||||
then
|
||||
echo "Version du systeme Linux Debian incompatible"
|
||||
exit 1
|
||||
@ -70,7 +70,7 @@ python3 -m venv venv || die "can't create Python 3 virtualenv"
|
||||
# ------------ INSTALL DES PAQUETS PYTHON (3.7)
|
||||
# ScoDoc8 uses pip in our env
|
||||
source venv/bin/activate
|
||||
pip install --upgrade pip
|
||||
# pip install --upgrade pip => bug [Errno 39] Directory not empty: '_internal'
|
||||
pip install wheel
|
||||
pip install -r requirements-3.7.txt
|
||||
|
||||
|
@ -61,8 +61,7 @@ init_postgres_user() { # run as root
|
||||
|
||||
# --- Ensure Unix user "scodoc" exists
|
||||
check_create_scodoc_user() {
|
||||
id -u "${SCODOC_USER}" &> /dev/null
|
||||
if [ "$?" != 0 ]
|
||||
if ! id -u "${SCODOC_USER}" &> /dev/null
|
||||
then
|
||||
echo "Creating unix user ${SCODOC_USER}"
|
||||
adduser --no-create-home --shell /bin/bash --gecos "ScoDoc service" "${SCODOC_USER}" || die "failed to create user"
|
||||
|
Loading…
Reference in New Issue
Block a user