#!/bin/sh
#item   ####description                                      ###on off ###
TMP=/var/log/setup/tmp
if [ ! -d $TMP ]; then
  mkdir -p $TMP
fi
cat /dev/null > $TMP/SeTnewtag
dialog --title "SELECTING PACKAGES FROM SERIES extra/packages (Applications)" \
       --checklist "Please confirm the packages you wish to install \
from series D.  Use the UP/DOWN keys to scroll through the list, and \
the SPACE key to deselect any items you don't want to install.  \
Press ENTER when you are \
done." 22 72 12 \
"avantfax" "AvantFax web frontend for hylafax" "on" \
"egroupware" "eGroupware groupware package" "on" \
"iptables_l7" "Iptables with L7-filter support" "on" \
"usermin" "Usermin module for Webmin" "on" \
"dovecot" "Dovecot IMAP server" "on" \
"dovecot-sieve" "Dovecot sieve plugin" "on" \
"horde-webmail" "horde groupware webmail" "on" \
"lms" "Lan Management System" "on" \
"ndiswrapper" "Use windows wireless drivers to Linux" \
"otrs" "Open Ticket Request System" "on" \
"postfix_vda" "Postfix mail server with VDA patch" "on" \
2> $TMP/SeTpkgs
if [ $? = 1 -o $? = 255 ]; then
 rm -f $TMP/SeTpkgs
 > $TMP/SeTnewtag
 for pkg in \
avantfax egroupware iptables_l7 lms dovecot dovecot-sieve usermin horde-webmail ndiswrapper otrs postfix_vda \
  ; do
  echo "$pkg: SKP" >> $TMP/SeTnewtag
 done
 exit
fi
cat /dev/null > $TMP/SeTnewtag
for PACKAGE in \
avantfax egroupware iptables_l7 lms dovecot dovecot-sieve usermin horde-webmail ndiswrapper otrs postfix_vda \
 ; do
 if fgrep \"$PACKAGE\" $TMP/SeTpkgs 1> /dev/null 2> /dev/null ; then
  echo "$PACKAGE: ADD" >> $TMP/SeTnewtag
 else
  echo "$PACKAGE: SKP" >> $TMP/SeTnewtag
 fi
done
rm -f $TMP/SeTpkgs
