#! /bin/sh #------------------------------------------------------------------------------ # part of the sn-package for eisfair # search for groups in grouplist # last update: 2003/09/11 # (c) 2001-2003 by Christian Würdig (eisfair@chriswue.de) #------------------------------------------------------------------------------ outgoing="/var/spool/news/.outgoing" if [ ! -d $outgoing ]; then echo colecho "No external newsserver found." br x br echo /var/install/bin/anykey exit 0 fi clrhome colecho "searching for newsgroups in grouplist of external newsserver" gn echo tmpserv="/tmp/.snserv" tmpgl="/tmp/.sngl" /var/install/bin/sn-getserver if [ -f $tmpserv ]; then read ns < $tmpserv rm -f $tmpserv else echo; echo "quit"; echo /var/install/bin/anykey exit fi echo serverdir="$outgoing/$ns:119" if [ -f $serverdir/grouplist ]; then echo -e "expression to search for: \c" read regexp echo echo "scanning List" grep "$regexp" $serverdir/grouplist >$tmpgl anz=`grep -c "$regexp" $serverdir/grouplist` else echo "no grouplist found for $ns" echo /var/install/bin/anykey exit fi if [ "$anz" -eq 0 ]; then echo colecho "no newsgroups found matching '$regexp'" br x br elif [ "$anz" -gt 0 -a "$anz" -lt 20 ]; then clrhome colecho "$anz newsgroups found matching '$regexp':" gn echo while read line; do echo "$line" done < $tmpgl else n=0 while read line; do n=`expr $n + 1` eval ng_$n='"$line"' done < $tmpgl rm -f $tmpgl cnt=0 s=0 all=20 i=0 clrhome colecho "$anz newsgroups found matching '$regexp' (20/$anz):" gn echo while [ "$i" -lt "$n" ]; do i=`expr $i + 1` eval line='$ng_'$i echo $line cnt=`expr $cnt + 1` s=`expr $s + 1` if [ "$all" -lt "$anz" ]; then all=`expr $all + 1` fi if [ "$s" -eq "$anz" ]; then cnt=0 elif [ "$cnt" -eq 20 ]; then echo echo -e "press ENTER to continue ('x' to exit): \c" read l if [ "$l" = "x" ]; then break fi cnt=0 clrhome colecho "$anz newsgroups found matching '$regexp' ($all/$anz):" gn echo fi done fi echo /var/install/bin/anykey exit 0