#!/usr/bin/sh #---------------------------------------------------------------------------- # /var/install/bin/sn-showng - show subscribed NG's # # Creation : 2001 chriswue # Last update: $Id$ # # Copyright (c) 2001-2003 by Christian Wuerdig eisfair(at)chriswue(dot)de # Copyright (c) 2010-@@YEAR@@ Holger Bruenjes, holgerbruenjes(at)gmx(dot)net # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. #---------------------------------------------------------------------------- . /var/install/include/eislib . /var/lib/sn/sn.info # --------------------------------------------------------------------------- # main # --------------------------------------------------------------------------- cd /var/spool/news/ anz=$(ls -1 | grep -c ".*") SN_TITLE="Subscribed newsgroups (${anz})" SN_FLAGS='--indent 12 --spread --list' SN_COLS='60*' SN_ROWS=0 export SN_TITLE export SN_FLAGS export SN_COLS for i in * do SN_ROWS=$((${SN_ROWS} + 1)) eval SN_${SN_ROWS}_1=\"${i}\" export SN_${SN_ROWS}_1 export SN_ROWS done SN_QUESTION='View' export SN_QUESTION ask_tmpfile=$(${MKTEMP} -t XXXXXXXXXXXXX) ${CHOOSE} SN 1 > ${ask_tmpfile} rc=${?} read answer < ${ask_tmpfile} rm -f ${ask_tmpfile} # if ask break, ask returned 255 if [ ${rc} = 255 ] then answer=0 fi unset SN_FLAGS unset SN_SUBTITLE case ${answer} in '') : ;; 0) exit 127 ;; esac exit 0 # --------------------------------------------------------------------------- # end # ---------------------------------------------------------------------------