############################## -*- Mode: sh -*- #############################
## wwwoffle-outgoing-regexp-rm -- remove WWWOFFLE outgoing requests via regular expression
## Copyright       : GNU General Public License
## Author          : root
## Created On      : Sat Oct 13 04:16:34 2001
## Last Modified By: root
## Last Modified On: Wed Oct 24 08:21:57 2001
## Update Count    : 4
## Status          : Use with caution!
###############################################################################

# The newest copy of this program is on
# http://www.geocities.com/jidanni/wwwoffle-jidanni.html

# must be root to use
set -e
wwwoffle-ls outgoing|awk '$6 ~ "'$1'" {print $6;flag=1}
	    END{if (!flag){print "no matches";exit 1}}'
echo -n 'Delete these from outgoing request list? [n]|y  '
read answer
test x$answer == xy &&
cd /var/spool/wwwoffle/outgoing &&
wwwoffle-ls outgoing|awk '$6 ~ "'$1'" {print $1}'|xargs rm

#should get the list only once, in case of other users adding requests concurrently
