s3: Implement bandwidth limit.
[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
cb661c39 21elif test "$UID" != "0"; then
dbc6bd3c 22 echo "This program must be run as root"
23 usage
24 exit 1
9278de4a 25else
26 LIST_NAME=$1
27 LIST_DOMAIN=$2
28 LIST_URL=$3
29 LIST_USER=$4
30 LIST_PASS=$5
31fi
32
dbc6bd3c 33# If DOMAIN is hcoop.net, force it to be lists.hcoop.net.
34if test "$LIST_DOMAIN" = "hcoop.net"; then
35 LIST_DOMAIN=lists.hcoop.net
36fi
37
38sudo -u list $BIN/newlist \
39 $LIST_NAME@$LIST_DOMAIN $LIST_USER@hcoop.net $LIST_PASS </dev/null
12fb4bd2 40
b85c4e3b 41# By default, use our list admin website for the public interface.
42# This can be changed after the user has set up their mailMan
43# directive. We do this because the default is
44# http://lists.hcoop.net, without SSL, which makes list admin not work
45# at all.
9278de4a 46/afs/hcoop.net/common/etc/scripts/change-list-url $LIST_NAME $LIST_URL
12fb4bd2 47
9278de4a 48echo "Sucessfully created list $LIST_NAME"