#! /bin/sh
#
# Remove the original pop3 entry from /etc/inetd.conf, and add ours.
#

PATH=/bin:/usr/bin:/sbin:/usr/sbin

#
# In this simple case we don't need to check the arguments of the
# script; we can always install the new entry.
#

# First check if we have already been installed.
grep "^pop-3.*/in.qpopper" /etc/inetd.conf > /dev/null 2>&1 && exit 0

# Install the qpopper.
update-inetd --remove '^pop-3'
update-inetd --group MAIL --add \
  'pop-3\t\tstream\ttcp\tnowait\troot\t/usr/sbin/tcpd\t/usr/sbin/in.qpopper'

kill -1 `cat /var/run/inetd.pid` 2>/dev/null

exit 0
