#!/bin/bash

set -e

###############################################################################
#
# Add an inetd entry for client/server operations
#


if [ "$1" = configure ] && [ -n "$2" ] && dpkg --compare-versions "$2" lt 3.111-1; then
  update-inetd --remove "^#?gnats.*/gnatsd"
#  echo "'gnats' entry removed from inetd.conf, to be replaced with 'support'."
fi


if [ "$1" = configure ]; then
  update-inetd --add "#support		stream	tcp	nowait	gnats	/usr/sbin/tcpd	/usr/lib/gnats/gnatsd"
fi
