#!/bin/sh
# $Id: prerm 459 2003-02-22 21:54:34Z godisch $

set -e

if [ -x /usr/sbin/invoke-rc.d ]; then
	invoke-rc.d noffle stop
elif [ -x /etc/init.d/noffle ]; then
	/etc/init.d/noffle stop
fi

if [ -e /usr/share/debconf/confmodule ]; then
	. /usr/share/debconf/confmodule
	db_version 2.0
	db_get noffle/port || RET=""
	port="$RET"
	[ -z "$port" -o "$port" = 119 ] && port=nntp
	update-inetd --disable $port
	db_stop
fi

exit 0
