#!/bin/sh
# postinst script for gwhois
set -e
. /usr/share/debconf/confmodule

case "$1" in
  configure)
  db_get gwhois/inetd
  if [ "$RET" = "true" ]; then
    update-inetd --add 'whois	 	stream	tcp 	nowait	nobody	/usr/bin/gwhois gwhois'
  else
    update-inetd --pattern gwhois --remove whois 2>&1 >/dev/null
  fi

  db_get gwhois/mail
  if [ "$RET" = "true" ]; then
    echo "\$sendmail=1;1; # DO NOT CHANGE - use dpkg-reconfigure!" > /etc/gwhois/debconf.inc
  else
    echo "\$sendmail=0;1; # DO NOT CHANGE - use dpkg-reconfigure!" > /etc/gwhois/debconf.inc
  fi

  ;;
  abort-upgrade|abort-remove|abort-deconfigure)
  ;;
  *)
  echo "postinst called with unknown argument \`$1'" >&2
  exit 0
  ;;
esac

##DEBHELPER##
