#!/bin/sh -e # noffle-wipe-last-request -- wipe out noffle's last request # Copyright : http://www.fsf.org/copyleft/gpl.html # Author : Dan Jacobson -- http://jidanni.org/comp/ # Created On : Sat Nov 1 13:32:39 2003 # Last Modified On: Fri Oct 22 08:54:43 2004 # Update Count : 23 # Ever see a "[ NOFFLE INFO: Marked for download ]" appear when you # stumble into a article you don't want to download? # Well, this simple command will wipe it away, given that you just saw # that message, etc. etc. Must be root, etc. to use. : ${reqdir=/var/spool/noffle/requested} ${quick_editor=ed} #added some quick switches, perhaps for a future more general program case $1 in -l) #list noffle -R|cut -f 1 -d \ |xargs -r -n 1 noffle -a; exit ;; -e) #edit ls -ogS $reqdir/* cd $reqdir echo using $quick_editor on biggest file... exec $quick_editor `ls -S|sed q` ;; -h) #hunt echo XXXXXXXXXXX program not written yet;exit 9 noffle -R| while read article server do noffle -a $article echo -n 'delete request\? [n] ' read answer if test X$answer = Xy then echo XXXXXXXXXXX program not written yet fi done exit ;; esac test $# -lt 2||{ echo $0: args not allowed 1>&2; exit 33;} cd $reqdir case $1 in "") set -- `find . -type f -mmin -1 -printf %f\ ` test $# -eq 1||{ #limited blunder protection 1>&2 echo "$0: Not exactly one file in $PWD changed in last minute"; exit 4;};; -f) #force set -- `ls -t|sed q`;; *)echo $0: unknown option 1>&2; exit 55;; esac echo removing this line from $PWD/${1?} ed -s $1 <