create_sympa_listdomain.sh: some minor changes.

This commit is contained in:
Christoph 2021-02-19 15:23:56 +01:00
parent 19c1db748f
commit 5fbb856136

View File

@ -392,9 +392,6 @@ fi
# - if multiple listmasers where given in a blank separated list, we correct it here
# -
echo ""
echo "SYMPA_LISTMASTER: $SYMPA_LISTMASTER"
echo ""
declare -a listmaster_arr=()
for _listmaster in $SYMPA_LISTMASTER ; do
listmaster_arr+=("$_listmaster")
@ -408,7 +405,11 @@ for _listmaster in "${listmaster_arr[@]}" ; do
else
SYMPA_LISTMASTER="${SYMPA_LISTMASTER},$_listmaster"
fi
done
SYMPA_LISTMASTER="$(echo $SYMPA_LISTMASTER | sed 's/\(.\)\1*/\1/g')"
# Remove trailling ','
SYMPA_LISTMASTER="${SYMPA_LISTMASTER%,}"
# remove leading ','
SYMPA_LISTMASTER=${SYMPA_LISTMASTER#,}
if grep -e "^\s*listmaster" $SYMPA_MAIN_CONF_FILE > /dev/null 2>&1 ; then