From 8f5aaff1dec79be836742d162661131aa8a78fbb Mon Sep 17 00:00:00 2001 From: Philippe Caseiro Date: Mon, 28 May 2018 16:13:45 +0200 Subject: [PATCH] Manage multiple clients --- README.md | 1 + postservice/25-bdd-admin | 20 +++++++++++++------- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 9cbfd87..bd34617 100644 --- a/README.md +++ b/README.md @@ -81,6 +81,7 @@ GenConfig (Mode Normal) -> Database cluster : If you have only 2 nodes you need to setup an arbitrator, for this follow the tutorial in the eole-galera-arbitrator project page https://forge.cadoles.com/Cadoles/eole-galera-arbitrator + # How-to for Eole 2.6.2 (From scratch) ## Sources diff --git a/postservice/25-bdd-admin b/postservice/25-bdd-admin index f6b1ff5..2d6df4f 100755 --- a/postservice/25-bdd-admin +++ b/postservice/25-bdd-admin @@ -25,7 +25,6 @@ then accounts=($(CreoleGet accName)) limits="$(CreoleGet accLimitTarget '')" accLimits=(${limits// /}) - index=0 previousUsers=($(awk -F ':' '{print $1}' ${readerfile} )) @@ -42,13 +41,20 @@ then else ipAddr=($(CreoleGet ipMariaDBLimit)) ipMask=($(CreoleGet maskMariaDBLimit)) - if [[ ${ipMask} == "255.255.255.255" ]] - then - hostsList+=("${ipAddr}") - else - hostsList+=("${ipAddr}/${ipMask}") - fi + ix=0 + for ip in ${ipAddr[@]} + do + if [[ ${ipMask[${ix}]} == "255.255.255.255" ]] + then + hostsList+=("${ip}") + else + hostsList+=("${ip}/${ipMask[${ix}]}") + fi + ix=$((ix+1)) + done fi + + index=0 for hst in ${hostsList[@]} do SQL="DROP USER IF EXISTS '${user}'@'${hst}';"