Sync hcoop-backup changes from megacz
[hcoop/scripts.git] / listnew
CommitLineData
9278de4a 1#!/bin/bash -e
0fd9a980 2#
3# Make a new mailing list. Run as root on deleuze.
4#
9278de4a 5# Usage: listnew LISTNAME LISTDOMAIN LISTURL USER INITIAL_PASSWORD
0fd9a980 6
7BIN=/var/lib/mailman/bin
8
9278de4a 9function usage() {
10 echo "Usage: listnew list_name domain list_url user initial_password"
11}
12
13if test -n "$6"; then
14 echo "Too many arguments"
15 usage
16 exit 1
17elif test -z "$5"; then
18 echo "Not enough arguments"
19 usage
20 exit 1
21else
22 LIST_NAME=$1
23 LIST_DOMAIN=$2
24 LIST_URL=$3
25 LIST_USER=$4
26 LIST_PASS=$5
27fi
28
29sudo -u list $BIN/newlist $LIST_NAME@$LIST_DOMAIN $LIST_USER@hcoop.net \
30 $LIST_PASS </dev/null
12fb4bd2 31
b85c4e3b 32# By default, use our list admin website for the public interface.
33# This can be changed after the user has set up their mailMan
34# directive. We do this because the default is
35# http://lists.hcoop.net, without SSL, which makes list admin not work
36# at all.
9278de4a 37/afs/hcoop.net/common/etc/scripts/change-list-url $LIST_NAME $LIST_URL
12fb4bd2 38
9278de4a 39echo "Sucessfully created list $LIST_NAME"