X-Git-Url: https://git.distorted.org.uk/~mdw/ezmlm/blobdiff_plain/5b62e993b0af39700031c2875d7f6654e6a02850..f8beb284087c279acfb30506f5bb32baa4949b44:/ezmlm-accept.sh diff --git a/ezmlm-accept.sh b/ezmlm-accept.sh new file mode 100644 index 0000000..b723259 --- /dev/null +++ b/ezmlm-accept.sh @@ -0,0 +1,30 @@ +# [should have a bin/sh line and EZPATH added above by make] +# +# script to accept files in DIR/mod/pending. Use as: +# ezmlm-accept DIR file1 [file2 ...] +# where ``DIR'' is the list directory and ``file1'' is a file to be +# accepted. ``ezmlm-accept DIR DIR/mod/pending/*'' will accept all +# pending files. Files that are successfully sent to the list are +# deled. See man page for details. + +EZSEND="${EZPATH}/ezmlm-send" +FATAL='ezmlm-accept: fatal:' +if [ ! -x "$EZSEND" ]; then + echo "$FATAL please edit script to the correct ezmlm-send path" + exit 100; +fi + +DIR="$1" + +if [ -z "$1" ] || [ -z "$2" ]; then + echo "$FATAL usage: ezmlm-accept DIR file1 [file2 ...]" + exit 100; +fi + +while [ -n "$2" ]; do + if [ -x "$2" ]; then + $EZSEND $DIR < "$2" && rm -f "$2" + fi + shift +done +exit 0;