@@ -3,39 +3,48 @@ echo "Deploiment du module AD"
33echo " La position determinera l'ordre d'execution des backends (comme dans init.d)"
44read -p " Numero de demarrage du module (2 positions):" NUM
55echo " installation dans backends/${NUM} ad"
6+ MAJ=" 0"
67BACKEND=ad
78INSTALL=../../backends/${NUM}${BACKEND}
89if [ -d ../../backends/${NUM}${BACKEND} ]; then
910 read -p " Repertoire déjà existant voulez vous l'écraser ? (O/N)" -i " N" REPONSE
1011 if [ " $REPONSE " = " O" ]; then
1112 rm -rf ../../backends/${NUM}${BACKEND}
1213 else
13- exit 1
14+ echo " Mise à jour du backend"
15+ MAJ=" 1"
1416 fi
1517fi
16- mkdir ../../backends/${NUM}${BACKEND}
17- echo " Copie des fichiers dans ${INSTALL} "
18- mkdir $INSTALL /etc
19- cp ./etc/* $INSTALL /etc
20- mkdir $INSTALL /bin
21- mkdir $INSTALL /lib
18+ if [ $MAJ = " 0" ]; then
19+ mkdir ../../backends/${NUM}${BACKEND}
20+ echo " Copie des fichiers dans ${INSTALL} "
21+ mkdir $INSTALL /etc
22+ cp ./etc/* $INSTALL /etc
23+ mkdir $INSTALL /bin
24+ mkdir $INSTALL /lib
25+ mkdir $INSTALL /ps1_templates
26+ fi
2227PWD=` pwd`
2328chmod 700 ./bin/*
2429cp ./lib/__init__.py $INSTALL /lib
25- ln -s $PWD /lib/backend_utils.py $INSTALL /lib/backend_utils.py
26- ln -s $PWD /lib/ad_utils.py $INSTALL /lib/ad_utils.py
27- ln -s $PWD /bin/changepwd.py $INSTALL /bin/changepwd.py
28- ln -s $PWD /bin/ping.py $INSTALL /bin/ping.py
29- ln -s $PWD /bin/resetpwd.py $INSTALL /bin/resetpwd.py
30- ln -s $PWD /bin/delentity.py $INSTALL /bin/delentity.py
31- ln -s $PWD /bin/upsertidentity.py $INSTALL /bin/upsertidentity.py
32- ln -s $PWD /bin/activation.py $INSTALL /bin/activation.py
33- mkdir $INSTALL /ps1_templates
30+ ln -s $PWD /lib/backend_utils.py $INSTALL /lib/backend_utils.py 2> /dev/null
31+ ln -s $PWD /lib/ad_utils.py $INSTALL /lib/ad_utils.py 2> /dev/null
32+ ln -s $PWD /bin/changepwd.py $INSTALL /bin/changepwd.py 2> /dev/null
33+ ln -s $PWD /bin/ping.py $INSTALL /bin/ping.py 2> /dev/null
34+ ln -s $PWD /bin/resetpwd.py $INSTALL /bin/resetpwd.py 2> /dev/null
35+ ln -s $PWD /bin/delentity.py $INSTALL /bin/delentity.py 2> /dev/null
36+ ln -s $PWD /bin/upsertidentity.py $INSTALL /bin/upsertidentity.py 2> /dev/null
37+ ln -s $PWD /bin/activation.py $INSTALL /bin/activation.py 2> /dev/null
38+
3439cp ./ps1_templates/* $INSTALL /ps1_templates
3540chmod 600 $INSTALL /ps1_templates/*
3641cp config.yml $INSTALL
3742
3843echo " Le backend a été installé dans $INSTALL "
44+ if [ $MAJ = " 1" ]; then
45+ echo " la mise à jour a été faite"
46+ exit 0
47+ fi
3948echo " Configuration"
4049read -p " Adresse du serveur AD primaire : " HOST
4150read -p " Utilisateur (doit avoir les droits d'administration) : " USER
0 commit comments