#!/bin/sh
cat /dev/null > /tmp/SeTnewtag
dialog --title "select pkgs from network(Plamo Linux network system)" \
  --checklist "select packages from network series. \
You can move cursor with UP/DOWN key and push space \
key to select pkgs. After finish selecting, \
push Enter to start installation. " 24 72 15 \
"bind" "bind-9.3.1" "off" \
"bridge-utils" "ethenet bridge configuration tool" "on" \
"curl" "curl" "on" \
"cyrus_sasl" "Cyrus SASL library" "off" \
"ethtool" "ethenet configuration tool" "on" \
"fetchmail" "fetchmail 6.2.5" "on" \
"iptables" "iptables 1.3.1" "off" \
"libidn" "International Domain Name library" "on" \
"libiec61883" "implementation of IEC61883" "off" \
"libraw1394" "IEEE1394 raw device library" "off" \
"libssh2" "SSH2 library" "on" \
"mailx" "BSD mailx 5.5." "on" \
"metamail" "metamail-2.7" "on" \
"ncftp" "ncftp 3.1.9" "on" \
"ntp" "ntp-4.2.0" "on" \
"postfix" "MUA Postfix postfix-2.2.9" "off" \
"ppp" "PPP for Linux" "on" \
"procmail" "procmail" "on" \
"rsync" "rsync 2.6.2" "on" \
"setserial" "serial port configuration tool" "on" \
"w3m" "W3M(Web wo Miru)" "on" \
"wget" "wget-1.9.1" "on" \
"wireless_tools" "wireless_tools" "on" \
2> /tmp/SeTpkgs
if [ $? = 1 -o $? = 255 ]; then
  rm -f /tmp/SeTpkgs
  > /tmp/SeTnewtag
  for pkg in bind bridge-utils curl cyrus_sasl ethtool fetchmail iptables libidn libiec61883 libraw1394 libssh2 mailx metamail ncftp ntp postfix ppp procmail rsync setserial w3m wget wireless_tools  ; do 
  echo "$pkg: SKP" >> /tmp/SeTnewtag
  done
  exit
fi
cat /dev/null > /tmp/SeTnewtag
for PACKAGE in bind bridge-utils curl cyrus_sasl ethtool fetchmail iptables libidn libiec61883 libraw1394 libssh2 mailx metamail ncftp ntp postfix ppp procmail rsync setserial w3m wget wireless_tools  ; 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
