#!/bin/sh set -e # sysal-snmp postinst cd /etc/snmp mv snmptrapd.conf snmptrapd.conf.orig cp snmptrapd.conf.sysal snmptrapd.conf cd /etc/default # Debian7-check if grep "TRAPDRUN=no" snmpd 1>/dev/null then sed -i "s/TRAPDRUN=.*/TRAPDRUN=yes/" snmpd /etc/init.d/snmpd restart fi # Debian8-check if grep "TRAPDRUN=no" snmptrapd 1>/dev/null then sed -i "s/TRAPDRUN=.*/TRAPDRUN=yes/" snmptrapd fi # for systemd if which systemctl then systemctl start snmptrapd systemctl enable snmptrapd fi