#!/bin/sh

#
# append the control line to activate our trap handler
#
SNMPTRAPDCONF=/etc/snmp/snmptrapd.conf
DEFLINE="traphandle default /usr/sbin/snmptrapfmthdlr"

/bin/grep -qs "${DEFLINE}" ${SNMPTRAPDCONF}
if [ $? -eq 1 ]; then
  # line not there, append it
    echo "${DEFLINE}"  >> ${SNMPTRAPDCONF}

  #
  # restart the snmpd and snmptrapd
  #
  /etc/init.d/snmpd restart
fi

#DEBHELPER#
