#!/bin/sh # # snmppd This shell script takes care of starting and stopping # the snmp proxy daemon # # chkconfig: 345 80 30 # description: snmppd is a deamon which loads MIBs upon startup, \ # listens on TCP socket for SNMP GET requests, polls specified host \ # and returns value to caller process. # # processname: snmppd # pidfile: /var/run/snmppd/snmppd.pid # Source function library. . /etc/rc.d/init.d/functions # Source networking configuration. . /etc/sysconfig/network # Check that networking is up. [ "${NETWORKING}" = "no" ] && exit 0 RETVAL=0 # See how we were called. case "$1" in start) echo -n "Starting snmppd: " daemon snmppd RETVAL=$? echo [ $RETVAL -eq 0 ] && touch /var/lock/subsys/snmppd ;; stop) echo -n "Stopping snmppd: " killproc snmppd RETVAL=$? echo [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/snmppd ;; status) status snmppd RETVAL=$? ;; restart|reload) $0 stop $0 start RETVAL=$? ;; condrestart) [ -f /var/lock/subsys/snmppd ] && $0 restart RETVAL=$? ;; *) echo "Usage: snmppd {start|stop|status|restart|condrestart|reload}" exit 1 esac exit $RETVAL