From 7ee33529c03fd1919e9c1062735461ec4a6fed66 Mon Sep 17 00:00:00 2001 From: Fab Date: Wed, 2 Dec 2026 13:31:23 +0100 Subject: [PATCH] =?UTF-8?q?autorise=20un=20mail=20secours=20=C3=A0=20null?= =?UTF-8?q?=20dans=20le=20ldap?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/update-ldap-paheko.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bin/update-ldap-paheko.sh b/bin/update-ldap-paheko.sh index 3ade959..4f0235a 100755 --- a/bin/update-ldap-paheko.sh +++ b/bin/update-ldap-paheko.sh @@ -4,7 +4,9 @@ #KOI: lire les emails secours et tel sur chaque fiche paheko et les rajouter/modifier le ldap #KAN: 21/08/2026 #KAN: le 25/10/2026 -# grosse modif, il faut passer des argumens pour modifier les quotas, le mail secours ou le nuro de tel +# grosse modif, il faut passer des arguments pour modifier les quotas, le mail secours ou le no de tel + +#MAJ fab du 02/12/2026: autoriser null dans email_secours #on récupère toutes les variables et mdp #KAZ_ROOT=/kaz @@ -122,10 +124,11 @@ LdapUpdateUniq() then PBARGU="${PBARGU} - Le numéro est malformé" fi + [ "${MAILSECOURS}" = IDEM ] && MAILSECOURS=$(echo ${I_REP} | awk {'print $2'}) [ "${QUOTA}" = IDEM ] && QUOTA=$(echo ${I_REP} | awk {'print $4'}) [[ ${EMAIL} =~ ${regexMail} ]] || PBARGU="${PBARGU} - Le mail est malformé" - [[ ${MAILSECOURS} =~ ${regexMail} ]] || PBARGU="${PBARGU} - Le mail de secours est malformé" + [[ -z "${MAILSECOURS}" || "${MAILSECOURS}" == "null" || "${MAILSECOURS}" =~ ${regexMail} ]] || PBARGU="${PBARGU} - Le mail de secours est malformé" [[ ${QUOTA} =~ ^[0-9]+$ ]] || echo "le quota doit être en chiffres" # on affiche les erreurs si la variable n'est pas vide [ ! -z "${PBARGU}" ] && { echo ${PBARGU};exit 1; }