From 90bf430e7ea79090b47538c47c2f077b548b1cfb Mon Sep 17 00:00:00 2001 From: Doug Le Tough Date: Sat, 22 Jul 2017 06:36:57 +0200 Subject: [PATCH] =?UTF-8?q?"M=C3=A0J=20script=20install.sh"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/expl_deploy_socle.sh | 3 ++- conf/install_init.conf | 6 ++++++ install.sh | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 40 insertions(+), 1 deletion(-) diff --git a/bin/expl_deploy_socle.sh b/bin/expl_deploy_socle.sh index 056f675..89e6b69 100755 --- a/bin/expl_deploy_socle.sh +++ b/bin/expl_deploy_socle.sh @@ -93,7 +93,7 @@ function scp_socle_dir function install_socle { fct_message "Installation du socle sur ${vm}:" -color rose - ssh ${vm} "cd ${socle_dir} && ./install.sh" + ssh ${vm} "cd ${socle_dir} && sudo ./install.sh" RET_VAL=$? if [ ! ${RET_VAL} -eq 0 ]; then ERROR="Erreur lors de l'installation du socle." @@ -106,5 +106,6 @@ function install_socle #----------------------------------------------------------------------- check_socle_dir +scp_socle_dir install_socle fct_erreur 0 diff --git a/conf/install_init.conf b/conf/install_init.conf index 13465f8..07eac26 100644 --- a/conf/install_init.conf +++ b/conf/install_init.conf @@ -10,3 +10,9 @@ PROFILE_DIR=/etc/profile.d # Le nom du fichier de profile système à créer PROFILE_FILE=tetalab.sh + +# Utilisateur gestionnaire de l'infrastructure +ADMIN_USER=asr + +# Groupe des utilisateurs habitlités à utiliser le socle +ADMIN_GROUP=asr diff --git a/install.sh b/install.sh index 4a38fd0..8131498 100755 --- a/install.sh +++ b/install.sh @@ -122,3 +122,35 @@ if [ ! ${MSGS_NUM} -eq 0 ]; then fi continue_on_ok fi + +# Gestion des droits et permissions +echo -en "\033[93m * Application des droits sur les répertoires:\033[0m " +chown -R ${ADMIN_USER}:${ADMIN_GROUP} ${NC_EXPL_ROOT} +RET_VAL=$? +if [ ! ${RET_VAL} -eq 0 ]; then + exit_on_error "Erreur lors l'application des droits" +fi +continue_on_ok + +echo -e "\033[93m * Application des permissions sur les répertoires:\033[0m " +for DIR in cpt bin conf dat lib man mod msg +do + echo -en " * ${NC_EXPL_ROOT}/${DIR} " + chmod -R 550 ${NC_EXPL_ROOT}/${DIR} + RET_VAL=$? + if [ ! ${RET_VAL} -eq 0 ]; then + exit_on_error "Erreur lors l'application des droits sur ${NC_EXPL_ROOT}/${DIR}" + fi + continue_on_ok +done + +for DIR in cpt hist log tmp +do + echo -en " * ${NC_EXPL_ROOT}/${DIR} " + chmod -R 770 ${NC_EXPL_ROOT}/${DIR} + RET_VAL=$? + if [ ! ${RET_VAL} -eq 0 ]; then + exit_on_error "Erreur lors l'application des droits sur ${NC_EXPL_ROOT}/${DIR}" + fi + continue_on_ok +done