#!/bin/sh -f

if [ -f /usr/share/snmp/snmpd.conf ]; then
   eline=`grep get5820stats /usr/share/snmp/snmpd.conf`
   if test "$eline" = ""; then
      echo "pass .1.3.6.1.4.1.4413.4.1 /bin/sh /usr/bin/get5820stats" >> /usr/share/snmp/snmpd.conf
      echo "if snmp daemon is running, you must stop it and restart it."
   else
      echo "SNMP agent is already configured to report cryptonet statistics."
      echo "Make sure the snmp agent daemon is running to get cryptonet statistics."
   fi
else
   echo "pass .1.3.6.1.4.1.4413.4.1 /bin/sh /usr/bin/get5820stats" >> /usr/share/snmp/snmpd.conf
   echo "SNMP agent configured to report cryptonet statistics."
   echo "Make sure the snmp agent daemon is running to get cryptonet statistics."
fi
if [ -f /etc/snmp/snmpd.conf ]; then
   e1line=`grep get5820stats /etc/snmp/snmpd.conf`
   if test "$e1line" = ""; then
      echo "pass .1.3.6.1.4.1.4413.4.1 /bin/sh /usr/bin/get5820stats" >> /etc/snmp/snmpd.conf
      echo "if snmp daemon is running, you must stop it and restart it."
   else
      echo "SNMP agent is already configured to report cryptonet statistics."
      echo "Make sure the snmp agent daemon is running to get cryptonet statistics."
   fi
fi

