Project

General

Profile

Anomalie #3305

migre-domaine-messagerie.sh compatible 2.3

Added by Emmanuel GARETTE over 7 years ago. Updated over 7 years ago.

Status:
Fermé
Priority:
Normal
Assigned To:
Category:
-
Start date:
04/14/2012
Due date:
% Done:

100%

Distribution:
EOLE 2.3

Description

Le patch suivant rend compatible migre-domaine-messagerie.sh sur 2.3 :

--- migre-domaine-messagerie.sh    2012-04-14 21:20:55.288341905 +0200
+++ /usr/share/eole/backend/migre-domaine-messagerie.sh    2012-04-14 21:38:20.064592746 +0200
@@ -1,4 +1,5 @@
 #!/bin/bash
+
 . /usr/share/eole/FonctionsEoleNg
 old=$1
 new=$2
@@ -7,15 +8,16 @@
     echo -e "usage : $0 anciendomaine nouveaudomaine\n" 
     exit 1
 fi
-Question "Migrer de $1 vers $2" 
+Question_ouinon "Migrer de $1 vers $2" 
 if [ $? -ne 0 ];then
     echo "Abandon" 
     exit 1
 fi
-oldsympa="/var/lib/sympa/expl/i-$old" 
-newsympa="/var/lib/sympa/expl/i-$new" 
-oldetc="/etc/sympa/i-$old" 
-newetc="/etc/sympa/i-$new" 
+symparoot="$container_path_mail/var/lib/sympa/expl" 
+oldsympa="$symparoot/i-$old" 
+newsympa="$symparoot/i-$new" 
+oldetc="$container_path_mail/etc/sympa/i-$old" 
+newetc="$container_path_mail/etc/sympa/i-$new" 
 ldif="/root/annuaire-`date +%Y%m%d`.ldif" 
 ldif2="/root/annuaire-`date +%Y%m%d`-2.ldif" 
 # vérifications préalables...
@@ -27,11 +29,6 @@
     echo "Erreur : le répertoire $oldetc n'existe pas !" 
     exit 1
 fi
-# le répertoire a pu être créé par reconfigure
-#if [ -d $newetc ];then
-#    echo "Erreur : le répertoire $newetc existe déjà !" 
-#    exit 1
-#fi
 if [ -d $newsympa ];then
     echo "Erreur : le répertoire $newsympa existe déjà !" 
     exit 1
@@ -41,25 +38,26 @@
     exit 1
 fi
 echo "# Sauvegarde de l'annuaire dans $ldif..." 
-/etc/init.d/slapd stop
-slapcat > $ldif
-cp -f $ldif $ldif2
+Service slapd stop annuaire
+RunCmd "slapcat -v -f /etc/ldap/slapd.conf" annuaire > $ldif
+cp -f $ldif $container_path_annuaire/$ldif2
 echo "# Modification de l'annuaire..." 
-sed -i "s/$old/$new/g" $ldif2
-rm -f /var/lib/ldap/*.*
-slapadd -l $ldif2
-chown openldap:openldap /var/lib/ldap/*.*
-/etc/init.d/slapd start
-rm -f $ldif2
+sed -i "s/$old/$new/g" $container_path_annuaire/$ldif2
+
+rm -f $container_path_annuaire/var/lib/ldap/*.*
+RunCmd "/usr/sbin/slapadd -f /etc/ldap/slapd.conf -l $ldif2" annuaire
+RunCmd "chown openldap:openldap /var/lib/ldap/*.*" annuaire
+Service slapd start annuaire
+rm -f $container_path_annuaire/$ldif2
 echo "# Migration des configurations sympa..." 
 mv $oldetc $newetc
 mv $oldsympa $newsympa
-for confsympa in `find /var/lib/sympa/expl -name config`;do
+for confsympa in `find $symparoot -name config`;do
     sed -i "s/$old/$new/g" $confsympa
 done
 echo "# Migration des alias Exim4..." 
-sed -i "s/$old/$new/g" /etc/mail/sympa.aliases
-sed -i "s/$old/$new/g" /etc/aliases
+sed -i "s/$old/$new/g" $container_path_mail/etc/mail/sympa.aliases
+sed -i "s/$old/$new/g" $container_path_mail/etc/aliases
 echo -e "\nMigration terminée : modifiez la variable \"Nom de domaine de la messagerie\"" 
 echo -e "puis lancez la commande *reconfigure*\n" 
 exit 0

Associated revisions

Revision 26460897 (diff)
Added by Emmanuel GARETTE over 7 years ago

migre-domaine-messagerie.sh : modification du script en suivant les préconisations EOLE 2.3 (fixes #3305)

History

#1 Updated by Emmanuel GARETTE over 7 years ago

  • Status changed from Nouveau to Résolu
  • % Done changed from 0 to 100

#2 Updated by Joël Cuissinat over 7 years ago

  • Assigned To set to Emmanuel GARETTE
  • Target version set to Mises à jour 2.3.5 RC

#3 Updated by Bruno Boiget over 7 years ago

  • Status changed from Résolu to Fermé

testé sur amonecole en 2.3.5 RC

Also available in: Atom PDF