From 2758ba5982e1f3a310f4ffec59e76e2557491b99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Floure?= Date: Sun, 7 Oct 2018 22:18:47 +0200 Subject: [PATCH] Add "IGNORED" state to actions on list members --- unipoly-mlmmj-ldap-sync | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/unipoly-mlmmj-ldap-sync b/unipoly-mlmmj-ldap-sync index 37c3ba7..c9ed30d 100755 --- a/unipoly-mlmmj-ldap-sync +++ b/unipoly-mlmmj-ldap-sync @@ -76,30 +76,34 @@ def main if (subscribers.include?(m)) subscribers.delete(m) else + print "Adding #{m}... " if (conf["lists_add"].include?(cn)) - print "Adding #{m}... " mlmmj_sub_binary = conf["mlmmj"]["sub_binary"] %x(#{mlmmj_sub_binary} -L #{list} -a #{m} -q -f -s) if ($?.exitstatus == 0) puts "OK" else - puts "Failed" + puts "FAILED" end + else + puts "IGNORED" end end end # Remove remaining "subcribers" (= they did not match with members) - if (conf["lists_remove"].include?(cn)) - subscribers.each do |s| - print "Removing #{s}... " + subscribers.each do |s| + print "Removing #{s}... " + if (conf["lists_remove"].include?(cn)) mlmmj_unsub_binary = conf["mlmmj"]["unsub_binary"] %x(#{mlmmj_unsub_binary} -L #{list} -a #{s} -q -s) if ($?.exitstatus == 0) puts "OK" else - puts "Failed" + puts "FAILED" end + else + puts "IGNORED" end end print "\n"