#!/bin/bash # Personnalisation de posh pour l'académie de Créteil DIR_TMP=personnalisation-cel DIR_SCRIPTS=/root/ DIR_POSH=/var/www/html/posh/ DIR_RESSOURCES=/var/www/html/ressources/ DIR_THEME_CAS=/usr/share/sso/interface/ URL_DIFFUSION=http://diff.ac-creteil.fr/di/ftp/scribe/EnvOLE-2.0 ARCHIVE_PERSONNALISATION=personnalisation.tar.gz SCRIPT_PERSONNALISATION=personnalisation.php #apache doit avoir le droit d'écrire dans le dossier "portal/selections" pour le génération du cache (api/scr_cache_generate_all.php) echo -e -n "Correction des droits sur le répertoire portal/selections... " cd $DIR_POSH find portal/selections -type d -exec chmod 770 {} \; find portal/selections -type f -exec chmod 660 {} \; echo -e "OK" #récupération et mise en place des fichiers echo -e -n "Récupération des fichiers de la personnalisation Créteil... " cd /tmp rm -rf $DIR_TMP mkdir $DIR_TMP cd $DIR_TMP wget -q "$URL_DIFFUSION/$ARCHIVE_PERSONNALISATION" tar xzf $ARCHIVE_PERSONNALISATION > /dev/null 2>&1 find posh -type d -exec chown root:www-data {} \; find posh -type d -exec chmod 770 {} \; find posh -type f -exec chown root:www-data {} \; find posh -type f -exec chmod 660 {} \; find ressources -type d -exec chown admin:www-data {} \; find ressources -type d -exec chmod 770 {} \; find ressources -type f -exec chown admin:www-data {} \; find ressources -type f -exec chmod 660 {} \; find interface -type d -exec chown root:root {} \; find interface -type d -exec chmod 755 {} \; find interface -type f -exec chown root:root {} \; find interface -type f -exec chmod 644 {} \; if [[ -d posh && -d ressources && -d interface && -d scripts ]] then echo -e "OK" else echo -e "ERREUR" fi echo -e -n "Mise en place des fichiers personnalisés... " cp -rpf scripts/* $DIR_SCRIPTS cp -rpf posh/* $DIR_POSH cp -rpf ressources/* $DIR_RESSOURCES cp -rpf interface/* $DIR_THEME_CAS echo -e "OK" echo -e -n "Suppression des fichiers temporaires... " cd /tmp rm -rf $DIR_TMP echo -e "OK" exit 0