#! /bin/bash # Killfile a luser in some newsgroup, optionally specifying a time to # give the luser a chance of a reprieve. # First parameter is the luser to killfile. # Second parameter is the newsgroup in which to killfile said luser. # Third and further parameters, if present, specify a time at which to # mail a message offering the luser a reprieve. Example time # specifications are "now + 1 week" and "8pm Nov 6"; see at(1) for # more details. exec 1>&2 # Everything goes to standard error if [ "X$1" == "X" -o "X$2" == "X" ]; then echo "Usage: $0 victim newsgroup [ time-spec ]" exit 1 fi VICTIM=$1 NEWSGROUP=$2 KILLFILE="$HOME/News/`echo $NEWSGROUP | tr . /`/KILL" if [ ! -f $KILLFILE ]; then echo "Killfile for $NEWSGROUP not found" exit 1 fi echo "/$VICTIM/f:j" >> $KILLFILE shift 2 if [ "X$1" != "X" ]; then echo "$HOME/bin/reprieve \"$VICTIM\" $NEWSGROUP \"`date`\"" | /usr/bin/at "$*" 2>/dev/null fi