Commit e0d9aa7e authored by Zhang Huangbin's avatar Zhang Huangbin Committed by Geert Stappers

Added options to mlmmj-make-ml

-d: The domain name part of the mailing list
-o: The email address of the list owner
-l: The language of list text template files
Committed-By: Geert Stappers's avatarGeert Stappers <stappers@stappers.nl>
parent a8bee54a
......@@ -9,12 +9,18 @@ mlmmj-make-ml \- create a mailing list for mlmmj
.HP
\fB\-L\fR: The name of the mailing list
.HP
\fB\-d\fR: The domain name part of the mailing list
.HP
\fB\-s\fR: Your spool directory (default /var/spool/mlmmj)
.HP
\fB\-a\fR: Create the needed entries in your /etc/aliases file
.HP
\fB\-c\fR: User to chown the spool directory to (default not to chown at all)
.HP
\fB\-o\fR: The email address of the list owner
.HP
\fB\-l\fR: The language of list text template files
.HP
\fB\-z\fR: Do nothing for now
.SH DESCRIPTION
This is an interactive script which creates the mailing list directory and thus
......
......@@ -12,13 +12,16 @@ $0
[-h] [-L listname] [-s spooldir] [-a] [-c user] [-z]
-h: display this help text
-L: the name of the mailing list
-d: the domain name part of the mailing list
-s: your spool directory (default $DEFAULTDIR)
-a: create the needed entries in your $ALIASFILE file
-c: user to chown the spool directory to (default not to chown at all)
-o: email address of the list owner (default 'postmaster')
-l: the language of list text template files
-z: do nothing for now
"
while getopts ":hL:s:azc:" Option
while getopts ":hL:s:azc:d:o:l:" Option
do
case "$Option" in
h )
......@@ -32,6 +35,9 @@ case "$Option" in
L )
LISTNAME="$OPTARG"
;;
d )
FQDN="$OPTARG"
;;
s )
SPOOLDIR="$OPTARG"
;;
......@@ -42,6 +48,12 @@ case "$Option" in
DO_CHOWN=1
CHOWN="$OPTARG"
;;
o )
OWNER="$OPTARG"
;;
l )
TEXTPATH="$OPTARG"
;;
* )
echo "$0: invalid option"
echo "Try $0 -h for more information."
......@@ -78,47 +90,54 @@ done
test -f "$LISTDIR"/index || touch "$LISTDIR"/index
echo -n "The Domain for the List? [] : "
read FQDN
if [ -z "$FQDN" ]; then
FQDN=`domainname -f`
echo -n "The Domain for the List? [] : "
read FQDN
if [ -z "$FQDN" ]; then
FQDN=`domainname -f`
fi
fi
echo -n "The emailaddress of the list owner? [postmaster] : "
read OWNER
if [ -z "$OWNER" ]; then
OWNER="postmaster"
if [ -z $OWNER ]; then
echo -n "The emailaddress of the list owner? [postmaster] : "
read OWNER
if [ -z "$OWNER" ]; then
OWNER="postmaster"
fi
fi
echo "$OWNER" > "$LISTDIR"/"control/owner"
(
cd "@textlibdir@"
echo
echo "For the list texts you can choose between the following languages or"
echo "give a absolute path to a directory containing the texts."
echo
echo "Available languages:"
ls
TEXTPATHDEF=en
echo -n "The path to texts for the list? [$TEXTPATHDEF] : "
read TEXTPATHIN
if [ -z "$TEXTPATHIN" ] ; then
TEXTPATH="$TEXTPATHDEF"
else
TEXTPATH="$TEXTPATHIN"
fi
if [ ! -d "$TEXTPATH" ]; then
echo
echo "**NOTE** Could not copy the texts for the list"
echo "Please manually copy the files from the listtexts/ directory"
echo "in the source distribution of mlmmj."
sleep 2
else
cp "$TEXTPATH"/* "$LISTDIR"/"text"
fi
cd "@textlibdir@"
if [ -z $TEXTPATH ]; then
echo
echo "For the list texts you can choose between the following languages or"
echo "give a absolute path to a directory containing the texts."
echo
echo "Available languages:"
ls
TEXTPATHDEF=en
echo -n "The path to texts for the list? [$TEXTPATHDEF] : "
read TEXTPATHIN
if [ -z "$TEXTPATHIN" ] ; then
TEXTPATH="$TEXTPATHDEF"
else
TEXTPATH="$TEXTPATHIN"
fi
fi
)
if [ ! -d "$TEXTPATH" ]; then
echo
echo "**NOTE** Could not copy the texts for the list"
echo "Please manually copy the files from the listtexts/ directory"
echo "in the source distribution of mlmmj."
sleep 2
else
cp "$TEXTPATH"/* "$LISTDIR"/"text"
fi
LISTADDRESS="$LISTNAME@$FQDN"
echo "$LISTADDRESS" > "$LISTDIR"/control/"listaddress"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment