ca-install: Mention that validation is done.
[clinton/scripts.git] / listnew
1 #!/bin/bash -e
2 #
3 # Make a new mailing list. Run as root on deleuze.
4 #
5 # Usage: listnew LISTNAME LISTDOMAIN LISTURL USER INITIAL_PASSWORD
6
7 BIN=/var/lib/mailman/bin
8
9 function usage() {
10 echo "Usage: listnew list_name domain list_url user initial_password"
11 }
12
13 if test -n "$6"; then
14 echo "Too many arguments"
15 usage
16 exit 1
17 elif test -z "$5"; then
18 echo "Not enough arguments"
19 usage
20 exit 1
21 else
22 LIST_NAME=$1
23 LIST_DOMAIN=$2
24 LIST_URL=$3
25 LIST_USER=$4
26 LIST_PASS=$5
27 fi
28
29 sudo -u list $BIN/newlist $LIST_NAME@$LIST_DOMAIN $LIST_USER@hcoop.net \
30 $LIST_PASS </dev/null
31
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.
37 /afs/hcoop.net/common/etc/scripts/change-list-url $LIST_NAME $LIST_URL
38
39 echo "Sucessfully created list $LIST_NAME"