#!/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 N (NETWORK/NEWS/MAIL/UUCP)" \
       --checklist "Please select the packages you wish to install \
from series N. Use the \
UP/DOWN keys to scroll through the list, and the SPACE key to select \
the packages you wish to install. Recommended packages have \
already been selected for you, but you may unselect them if you wish. \
Press ENTER when you are \
done." 22 70 11 \
"apache" "Apache WWW (HTTP) server" "off" \
"autofs" "Linux automounter" "on" \
"bind" "Berkeley Internet Name Domain server" "on" \
"bitchx" "BitchX Internet Relay Chat (IRC) client" "on" \
"bootp" "Internet Bootstrap Protocol server" "off" \
"curl" "Command-line URL transfer utility" "off" \
"dhcpcd" "DHCP client daemon" "on" \
"dhcp" "DHCP server (and client) utilities" "on" \
"epic4" "EPIC4 Internet Relay Chat (IRC) client" "on" \
"fetchmail" "Fetch mail from POP/IMAP/ETRN servers" "on" \
"getmail" "getmail " "on" \
"gnupg" "gnupg" "on" \
"imapd" "ipop3d/imapd remote mail access daemons" "off" \
"inetd" "Internet super server daemon" "on" \
"iproute2" "iproute" "on" \
"iptables" "Firewall configuration utility for 2.4/2.6" "on" \
"iptraf" "iptraf" "on" \
"irssi" "irssi console irc client" "on " \
"lftp" "Shell-like FTP and HTTP transfer program" "on" \
"links" "Text-based WWW browser (with frames)" "on" \
"lynx" "Classic text-based WWW browser" "on" \
"mod_php" "PHP for Apache" "off" \
"mod_ssl" "OpenSSL-based SSL security for Apache" "off" \
"mutt" "The Mutt E-Mail Client" "on" \
"nail" "nail mail client" "on " \
"nc" "Netcat network utility" "off" \
"ncftp" "NcFTP file transfer utilities" "on" \
"netatalk" "Print/file server for Apple Macs" "off" \
"netpipes" "Network pipe utilities" "off" \
"netwatch" "Ncurses network monitor" "on" \
"newspost" "newspost" "off" \
"nfs-utils" "Network File System daemons" "off" \
"nmap" "Network scanning utility" "off" \
"ntp4" "Network Time Protocol" "off" \
"openssh" "OpenSSH Secure Shell" "on" \
"openssl" "OpenSSL Secure Sockets Layer toolkit" "on" \
"pidentd" "TCP/IP IDENT protocol server" "on" \
"pine" "Pine menu-driven mail program" "on" \
"popa3d" "Post Office Protocol v. 3 (POP3) server" "on" \
"portmap" "Manages NFS and other RPC connections" "on" \
"ppp" "Point-to-point protocol" "on" \
"procmail" "Mail delivery/filtering utility" "on" \
"proftpd" "The Professional FTP (file transfer) daemon" "on" \
"rdist" "Remote file distribution utility" "off" \
"rp-pppoe" "rp-pppoe" "off" \
"rsync" "Enhanced replacement for rcp" "off" \
"samba" "SMB print/file server for Windows LANs" "off" \
"sendmail" "The sendmail mail transport agent" "on" \
"sendmail-cf" "Extra configuration files for sendmail" "off" \
"slrn" "slrn" "off" \
"stunnel" "stunnel" "off" \
"tcpdump" "Tool for dumping network packets" "on" \
"tcpip" "Basic TCP/IP network programs and daemons" "on" \
"tin" "The 'tin' news reader" "on" \
"traceroute" "Packet tracing utility" "on" \
"uucp" "Taylor UUCP with HDB && Taylor configs" "off" \
"wget" "WWW/FTP retrieval tool" "on" \
"wireless-tools" "Tools for wireless networking" "off" \
"yptools" "NIS servers and clients" "off" \
"ytalk" "Multi-user talk program" "on" \
2> $TMP/SeTpkgs
if [ $? = 1 -o $? = 255 ]; then
 rm -f $TMP/SeTpkgs
 > $TMP/SeTnewtag
 for pkg in \
  apache autofs bind bitchx bootp curl dhcp dhcpcd epic4 fetchmail getmail gnupg imapd inetd iproute2 iptables iptraf irssi lftp links lynx mod_ssl mod_php mutt nail nc ncftp netatalk netpipes netwatch newspost nfs-utils nmap ntp4 openssh openssl pidentd pine popa3d portmap ppp procmail proftpd rdist rp-pppoe rsync samba sendmail sendmail-cf slrn stunnel tcpdump tcpip tin traceroute uucp wget wireless-tools yptools ytalk ; do
  echo "$pkg: SKP" >> $TMP/SeTnewtag
 done
 exit
fi
cat /dev/null > $TMP/SeTnewtag
for PACKAGE in \
  apache autofs bind bitchx bootp curl dhcp dhcpcd epic4 fetchmail imapd inetd inn iptables lftp links lynx mod_ssl mutt nc ncftp netatalk netpipes netwatch nfs-utils nmap ntp openssh openssl pidentd pine popa3d portmap ppp procmail proftpd rdist rsync samba sendmail sendmail-cf tcpdump tcpip tin traceroute uucp wget wireless-tools yptools ytalk \
 ; 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
