#!/bin/sh

#
# remove the activation line for our trap handler
#
SNMPTRAPDCONF=/etc/snmp/snmptrapd.conf
DEFLINE="traphandle default /usr/sbin/snmptrapfmthdlr"
TMPFILE=`tempfile`

if [ -r ${SNMPTRAPDCONF} ]; then
  /bin/grep -v "${DEFLINE}" ${SNMPTRAPDCONF} >${TMPFILE}
  /bin/cp ${TMPFILE} ${SNMPTRAPDCONF}
  /bin/rm -f ${TMPFILE}

  #
  # now restart the snmpd again
  #
  /etc/init.d/snmpd restart
fi

# Automatically added by dh_installinit
if [ -x "/etc/init.d/snmptrapfmt" ]; then
	if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
		invoke-rc.d snmptrapfmt stop || exit $?
	else
		/etc/init.d/snmptrapfmt stop || exit $?
	fi
fi
# End automatically added section

