#!/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" "on" \
"bridge_utils" "ethernet bridge configuration tool" "on" \
"curl" "curl" "on" \
"cyrus_sasl" "Cyrus SASL library" "on" \
"dnsmasq" "dnsmasq (small DNS and DHCP server)" "on" \
"ethtool" "ethernet configuration tool" "on" \
"fetchmail" "fetchmail" "on" \
"heimdal" "" "on" \
"hostapd" "IEEE 802.11 AP, IEEE 802.1X/WPA/WPA2/EAP/RADIUS Authenticator" "on" \
"iptables" "iptables" "on" \
"iw" "tool for configuring Linux wireless devices" "on" \
"libidn" "International Domain Name library" "on" \
"libiec61883" "implementation of IEC61883" "on" \
"libnl3" "" "on" \
"libpcap" "" "on" \
"libraw1394" "IEEE1394 raw device library" "on" \
"libssh" "" "on" \
"libssh2" "SSH2 library" "on" \
"mailx" "BSD mailx" "on" \
"metamail" "metamail" "on" \
"ncftp" "ncftp" "on" \
"ntp" "ntp" "on" \
"ntrack" "" "on" \
"parprouted" "transparent IP (Layer 3) proxy ARP bridging tool" "on" \
"postfix" "MUA Postfix postfix" "on" \
"ppp" "PPP for Linux" "on" \
"pptpd" "PPTP for Linux" "on" \
"procmail" "procmail" "on" \
"rsync" "rsync" "on" \
"setserial" "serial port configuration tool" "on" \
"socat" "socket relay tool" "on" \
"stunnel" "SSL encrypton wrapper" "on" \
"w3m" "W3M(Web wo Miru)" "on" \
"wget" "wget" "on" \
"wireless_tools" "wireless_tools" "on" \
"wpa_supplicant" "" "on" \
2> /tmp/SeTpkgs
if [ $? = 1 -o $? = 255 ]; then
  rm -f /tmp/SeTpkgs
  > /tmp/SeTnewtag
  for pkg in bind bridge_utils curl cyrus_sasl dnsmasq ethtool fetchmail heimdal hostapd iptables iw libidn libiec61883 libnl3 libpcap libraw1394 libssh libssh2 mailx metamail ncftp ntp ntrack parprouted postfix ppp pptpd procmail rsync setserial socat stunnel w3m wget wireless_tools wpa_supplicant  ; do 
  echo "$pkg: SKP" >> /tmp/SeTnewtag
  done
  exit
fi
cat /dev/null > /tmp/SeTnewtag
for PACKAGE in bind bridge_utils curl cyrus_sasl dnsmasq ethtool fetchmail heimdal hostapd iptables iw libidn libiec61883 libnl3 libpcap libraw1394 libssh libssh2 mailx metamail ncftp ntp ntrack parprouted postfix ppp pptpd procmail rsync setserial socat stunnel w3m wget wireless_tools wpa_supplicant  ; 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
