#!/bin/sh
#item   ####description                                      ###on off ###
cat /dev/null > /tmp/SeTnewtag 
dialog --title "n(network) シリーズの選択" \
       --checklist "nシリーズの中からインストールしたいパッケージを \
選んでください。カーソルの上下キーで \
動かし、選択は SPACE キーです。 \
選択が終われば ENTER を押してください。" 24 72 16 \
"bind9" "bind-9.2.1" "off" \
"iptables" "iptables 1.2.7a" "on" \
"mailx" "BSD mailx 5.5." "on" \
"metamail" "metamail-2.7" "on" \
"mh" "日本語対応 MH" "on" \
"mnews" "日本語ニュースリーダー mnews" "on" \
"ppp" "PPP 接続ソフト pppd" "on" \
"procmail" "メール振り分けプログラム procmail" "on" \
"rsync" "ファイル配布プログラム rsync" "on" \
"postfix" "メール配送プログラム postfix " "on" \
"tcpip" "TCP/IP ネットワーク用各種プログラム" "on" \
"proftpd" "proftpd FTP デーモン" "on" \
"ncftp" "FTPクライアント ncftp" "on" \
"wget"  "FTP/HTTP クライアント wget" "on" \
"dhcpcd" "DHCP client daemon" "on" \
"openssl" "OpenSSL" "on" \
"openssh" "OpenSSH" "on" \
"w3m" "W3M(Web wo Miru) tool" "on" \
"qpopper" "Qpopper" "on" \
2> /tmp/SeTpkgs
if [ $? = 1 -o $? = 255 ]; then 
 rm -f /tmp/SeTpkgs 
 > /tmp/SeTnewtag 
for pkg in bind9 iptables mailx metamail mh mnews ppp procmail rsync postfix tcpip dhcpcd openssl openssh w3m qpopper proftpd ncftp wget ; do
  echo "$pkg: SKP" >> /tmp/SeTnewtag 
 done 
 exit 
fi 
cat /dev/null > /tmp/SeTnewtag
for PACKAGE in bind9 iptables mailx metamail mh mnews ppp procmail rsync postfix tcpip dhcpcd openssl openssh w3m qpopper proftpd ncftp wget ; do
  if grep \"$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
