Removes getuser.sh, uniformises code in bin/.
[platal.git] / bin / lists.make_tpl.sh
1 #!/bin/sh
2
3 TEMPLATES='/etc/mailman/xorg'
4 URL='http://listes.polytechnique.org'
5 TARGET="/var/lib/mailman/lists/$1/fr"
6
7 MBOX=${1#*_}
8 FQDN=${1%%_*}
9
10 ALIST="${MBOX}-owner@${FQDN}"
11 LIST="${MBOX}@${FQDN}"
12 UIST="${MBOX}_${FQDN}"
13 ADMIN="$URL/admin/$UIST"
14 MEMBERS="$URL/members/$UIST"
15 MODERATE="$URL/moderate/$UIST"
16
17 mkdir -p "$TARGET"
18
19 for tpl in $TEMPLATES/*txt
20 do
21 cat $tpl \
22 | sed -e "s,{{{ALIST}}},$ALIST,g ; s,{{{LIST}}},$LIST,g ; s,{{{ADMIN}}},$ADMIN,g ; s,{{{MEMBERS}}},$MEMBERS,g ; s,{{{MODERATE}}},$MODERATE,g" \
23 > "$TARGET/${tpl#$TEMPLATES/}"
24 done
25