#!/bin/bash # Copyright (C) 2011 by the Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, # USA. # Path to config_list. You can add other options here, e.g. # CFL="/usr/local/mailman/bin/config_list -v" CFL="/usr/local/mailman/bin/config_list -v" function usage { echo usage: `basename $0` \"attribute = value\" ... listname echo echo Set attributes for listname with config_list according to the echo "attribute = value" arguments which may be repeated. echo echo Arguments containing whitespace must be quoted. echo echo Quoting string values for both Python and the shell can be echo tricky. The following will work: echo " " \"description = \'My fine list\'\" echo " " subject_prefix=\\\'[MyList]\\\' echo This will not: echo " " subject_prefix=\'[MyList]\' echo } if [ $# -lt 2 ]; then usage echo At least one \"attribute = value\" and listname required. exit 1 fi file=`mktemp` while [ $# -gt 1 ]; do if [[ ! "$1" =~ .+=.+ ]]; then usage echo Invalid argument: $1 rm $file exit 1 fi echo $1 >> $file shift done $CFL -i $file $1 rm $file