|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T m
Length: 3050 (0xbea) Types: TextFile Names: »makebatch«
└─⟦9ae75bfbd⟧ Bits:30007242 EUUGD3: Starter Kit └─⟦373604645⟧ »EurOpenD3/news/bnews.2.11/src.tar.Z« └─⟦3beb569ac⟧ └─⟦this⟧ »src/makebatch«
#!/bin/sh SHELL=/bin/sh PATH=.:/bin:/usr/bin:/usr/ucb:/usr/local export SHELL PATH LDIR=/usr/lib/news BDIR=/usr/spool/news/batched UUX="uux - -r -z -gN" CFLAGS= cflags=$CFLAGS compr=-nc LIM=25000 lim=$LIM CMD="sh -c" cmd=$CMD forget="no" cd $BDIR for rmt in $* do case $rmt in -f) forget="yes"; continue;; -b) cflags=$CFLAGS; continue;; -b*) cflags="$CFLAGS $rmt"; continue;; -s*) lim=`expr "$rmt" : '-s\(.*\)'`; continue;; -*c*) compr=$rmt; continue;; -r) cmd=$CMD; continue;; -r*) cmd=`echo $rmt | sed 's/-r/rsh /'`; continue;; BULK) if test $forget = "yes" then forget="no" continue fi break;; *) if test $forget = "yes" then forget="no" continue fi ;; esac # Continue if another sendbatch for this site is running if test -s $rmt.work then continue; fi # Keep a temporary backup; BLOG.* should be removed regularly if test -s $rmt then date >> BLOG.$rmt cat $rmt >> BLOG.$rmt fi while test $? -eq 0 -a \( -s $rmt -o -s $rmt.work \) do case $compr in # compress + encode -c7) (echo "#! c7unbatch"; $LDIR/batch $rmt $lim | $cmd "$LDIR/compress $cflags | $LDIR/encode") | if test -s $rmt.cmd then $rmt.cmd else $UUX $rmt!rnews fi ;; # compress only -c) (echo "#! cunbatch"; $LDIR/batch $rmt $lim | $cmd "$LDIR/compress $cflags") | if test -s $rmt.cmd then $rmt.cmd else $UUX $rmt!rnews fi ;; # no compress -nc) $LDIR/batch $rmt $lim | if test -s $rmt.cmd then $rmt.cmd else $UUX $rmt!rnews fi ;; esac done done if test "$rmt" != "BULK" then exit 0 fi # Handle multicast sites Clist=`grep 'CBULK$' $LDIR/sys | sed 's/:.*//'` C7list=`grep 'C7BULK$' $LDIR/sys | sed 's/:.*//'` # First cleanup a possible previous failure if test -s C.bf then for rmt in $C7list $Clist do if test -s $rmt.bf then $UUX $rmt!rnews < $rmt.bf rm $rmt.bf fi done fi # Exit if another BULK sendbatch is still running if test -s BULK.work then exit 0 fi if test ! -s BULK then # Keep a temporary backup; BLOG.* should be removed regularly; # We use CBULK only, since C7BULK contains the same list of # articles, only for different (compress+encode) sites if test -s CBULK -o -s C7BULK then date >> BLOG.BULK if test -s CBULK then sed 's/ .*//' < CBULK | tee BULK >> BLOG.BULK else sed 's/ .*//' < C7BULK | tee BULK >> BLOG.BULK fi else exit 0 fi rm -f CBULK C7BULK fi exitval=0 while test $exitval -eq 0 -a \( -s BULK -o -s BULK.work \) do echo "#! cunbatch" > C.bf echo "#! c7unbatch" > C7.bf if $LDIR/batch BULK $LIM | $cmd "$LDIR/compress $cflags" | tee -a C.bf | $cmd "$LDIR/encode" >> C7.bf then for rmt in $C7list do ln C7.bf $rmt.bf done for rmt in $Clist do ln C.bf $rmt.bf done for rmt in $C7list $Clist do if $UUX $rmt!rnews < $rmt.bf then rm $rmt.bf else exitval=1 fi done else cat BULK >> BULK.work; mv BULK.work BULK rm C*.bf exit 1 fi done if test $exitval -eq 0 then rm C*.bf fi exit $exitval