2021-07-30 09:36:30 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# Create USERS database for ScoDoc 8
|
|
|
|
# This script must be executed as root
|
|
|
|
#
|
|
|
|
# $db_name is passed as an environment variable
|
|
|
|
|
2021-08-02 10:34:28 +02:00
|
|
|
# Le répertoire de ce script:
|
|
|
|
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
|
|
|
|
|
|
|
|
source "$SCRIPT_DIR/config.sh"
|
|
|
|
source "$SCRIPT_DIR/utils.sh"
|
|
|
|
|
2021-07-30 09:36:30 +02:00
|
|
|
|
|
|
|
check_uid_root "$0"
|
|
|
|
|
|
|
|
# 1--- CREATION UTILISATEUR POSTGRESQL
|
|
|
|
init_postgres_user
|
|
|
|
|
|
|
|
# 2--- CREATION BASE UTILISATEURS
|
|
|
|
echo 'Creating postgresql database for users:' "$SCODOC_USER_DB"
|
|
|
|
su -c "createdb -E UTF-8 -p $POSTGRES_PORT -O $SCODOC_USER $SCODOC_USER_DB" "$POSTGRES_SUPERUSER"
|