Hello,

not sure anyone will have use for this, but I'm submitting it just in case.

I had to do the following on 100+ lists:

for each list:

the administrator(s) becomes moderator(s)
a new administrator is added
change administrator's password
change moderator's password

the list of affected lists is in a file named reglists
/home/cat/wk is a directory where I store previous admins lists
/home/cat/cfg is a directory where I build the new config file to run on the
lists

for i in `cat /home/cat/reglists`
do
   echo $i
   # create list of administrators
   /usr/sbin/list_admins $i | awk -F: '{print $3;}' | sed -e "s/,/\n/g" |sed
-e
"s/^ //" > /home/cat/wk/$i

   # create new configfile
   echo "# -*- python -*-" > cfg/$i
   echo "# -*- coding: us-ascii -*-" >>cfg/$i

   # new moderators
   MOD="moderator = ["
   for j in `cat wk/$i`; do MOD="$MOD'$j',"; done
   echo $MOD |sed -se "s/,$/]/"  >>cfg/$i

   # new administrator
   echo "owner = ['[EMAIL PROTECTED]']" >> cfg/$i

   # new passwords
   echo "import sha" >> cfg/$i
   echo "mlist.password = sha.new('newadminpasswde').hexdigest()" >> cfg/$i
   echo "mlist.mod_password = sha.new('newmoderatorpasswd').hexdigest()" >>
cfg/$i

   # apply config file
   /usr/lib/mailman/bin/config_list -i cfg/$i $i

done

thanks to Mark for helping me figuring out the change of passwords in the
config file


-- 
Cat
Burning Man Sysadmin Team
------------------------------------------------------
Mailman-Users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://www.python.org/cgi-bin/faqw-mm.py
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-users/archive%40jab.org

Security Policy: 
http://www.python.org/cgi-bin/faqw-mm.py?req=show&file=faq01.027.htp

Reply via email to