forked from ScoDoc/ScoDoc
Fix install scripts
This commit is contained in:
parent
79e43adbc3
commit
b17d664652
@ -136,7 +136,7 @@ def sco_delete_dept(dept):
|
|||||||
if os.getuid() != 0:
|
if os.getuid() != 0:
|
||||||
sys.stderr.write("sco_delete_dept: must be run by root\n")
|
sys.stderr.write("sco_delete_dept: must be run by root\n")
|
||||||
return 1
|
return 1
|
||||||
if os.system('cd config; ./delete_dept.sh -n "{}"'.format(dept)):
|
if os.system('cd tools && ./delete_dept.sh -n "{}"'.format(dept)):
|
||||||
sys.stderr.write("error deleting dept " + dept)
|
sys.stderr.write("error deleting dept " + dept)
|
||||||
return 1
|
return 1
|
||||||
return 0
|
return 0
|
||||||
@ -149,7 +149,7 @@ def sco_create_dept(dept):
|
|||||||
if os.getuid() != 0:
|
if os.getuid() != 0:
|
||||||
sys.stderr.write("sco_create_dept: must be run by root\n")
|
sys.stderr.write("sco_create_dept: must be run by root\n")
|
||||||
return 1
|
return 1
|
||||||
if os.system('cd config; ./create_dept.sh -n "{}"'.format(dept)):
|
if os.system('cd tools && ./create_dept.sh -n "{}"'.format(dept)):
|
||||||
sys.stderr.write("error deleting dept " + dept)
|
sys.stderr.write("error deleting dept " + dept)
|
||||||
return 1
|
return 1
|
||||||
return 0
|
return 0
|
||||||
|
@ -1,22 +1,20 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Create database for a ScoDoc instance
|
# Create database for a ScoDoc instance
|
||||||
# This script must be executed as postgres user
|
# This script must be executed as root
|
||||||
#
|
#
|
||||||
# $db_name is passed as an environment variable
|
# $db_name is passed as an environment variable
|
||||||
|
|
||||||
source config.sh
|
source config.sh
|
||||||
source utils.sh
|
source utils.sh
|
||||||
|
|
||||||
if [ $(id -n -u) != "$POSTGRES_SUPERUSER" ]
|
check_uid_root "$0"
|
||||||
then
|
|
||||||
die "$0 must be run as user $POSTGRES_SUPERUSER"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# 1--- CREATION UTILISATEUR POSTGRESQL
|
# 1--- CREATION UTILISATEUR POSTGRESQL
|
||||||
init_postgres_user
|
init_postgres_user
|
||||||
|
|
||||||
# 2--- CREATION BASE UTILISATEURS
|
# 2--- CREATION BASE UTILISATEURS
|
||||||
echo 'Creating postgresql database for users:' "$SCODOC_USER_DB"
|
echo 'Creating postgresql database for users:' "$SCODOC_USER_DB"
|
||||||
createdb -E UTF-8 -p "$POSTGRES_PORT" -O "$POSTGRES_USER" "$SCODOC_USER_DB"
|
su -c "createdb -E UTF-8 -p $POSTGRES_PORT -O $POSTGRES_USER $SCODOC_USER_DB" $POSTGRES_SUPERUSER
|
||||||
|
|
||||||
|
|
||||||
|
@ -80,6 +80,7 @@ change_scodoc_file_ownership() {
|
|||||||
# Création du répertoire local (scodoc-data) et vérification du propriétaire
|
# Création du répertoire local (scodoc-data) et vérification du propriétaire
|
||||||
set_scodoc_var_dir() {
|
set_scodoc_var_dir() {
|
||||||
echo "Checking $SCODOC_VAR_DIR..."
|
echo "Checking $SCODOC_VAR_DIR..."
|
||||||
|
[ -d "$SCODOC_VAR_DIR" ] || mkdir "$SCODOC_VAR_DIR" || die "can't create $SCODOC_VAR_DIR directory"
|
||||||
for d in archives photos tmp log config config/version config/depts config/logos
|
for d in archives photos tmp log config config/version config/depts config/logos
|
||||||
do
|
do
|
||||||
[ -d "$SCODOC_VAR_DIR/$d" ] || mkdir "$SCODOC_VAR_DIR/$d" || die "can't create $SCODOC_VAR_DIR/$d subdirectory"
|
[ -d "$SCODOC_VAR_DIR/$d" ] || mkdir "$SCODOC_VAR_DIR/$d" || die "can't create $SCODOC_VAR_DIR/$d subdirectory"
|
||||||
|
Loading…
Reference in New Issue
Block a user