File: postinst

package info (click to toggle)
snmptrapfmt 1.08sarge1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 172 kB
  • ctags: 90
  • sloc: ansic: 1,330; sh: 90; makefile: 54
file content (18 lines) | stat: -rwxr-xr-x 380 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/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