Import ezmlm-idx 0.40
[ezmlm] / ezmlm-accept.sh
CommitLineData
f8beb284
MW
1# [should have a bin/sh line and EZPATH added above by make]
2#
3# script to accept files in DIR/mod/pending. Use as:
4# ezmlm-accept DIR file1 [file2 ...]
5# where ``DIR'' is the list directory and ``file1'' is a file to be
6# accepted. ``ezmlm-accept DIR DIR/mod/pending/*'' will accept all
7# pending files. Files that are successfully sent to the list are
8# deled. See man page for details.
9
10EZSEND="${EZPATH}/ezmlm-send"
11FATAL='ezmlm-accept: fatal:'
12if [ ! -x "$EZSEND" ]; then
13 echo "$FATAL please edit script to the correct ezmlm-send path"
14 exit 100;
15fi
16
17DIR="$1"
18
19if [ -z "$1" ] || [ -z "$2" ]; then
20 echo "$FATAL usage: ezmlm-accept DIR file1 [file2 ...]"
21 exit 100;
22fi
23
24while [ -n "$2" ]; do
25 if [ -x "$2" ]; then
26 $EZSEND $DIR < "$2" && rm -f "$2"
27 fi
28 shift
29done
30exit 0;