#!/bin/bash # # linksysmon This shell script takes care of starting and stopping the linksysmon daemon. # # chkconfig: 235 99 01 # description: Accepts SNMP logging from Linksys BEFSR / # Firewalls # processname: linksysmon # pidfile: /var/run/linksysmon.pid # config: /etc/linksysmon.conf # config: /etc/sysconfig/linksysmon # Source function library. . /etc/rc.d/init.d/functions # Source networking configuration. . /etc/sysconfig/network # Check that networking is up. [ "${NETWORKING}" = "no" ] && exit 0 [ -f /etc/linksysmon.conf ] || exit 0 [ -f /etc/sysconfig/linksysmon ] && . /etc/sysconfig/linksysmon RETVAL=0 # See how we were called. case "$1" in start) gprintf "Starting linksysmon: " linksysmon ${OPTIONS:-""} 2>/dev/null >/dev/null & success || failure RETVAL=$? echo [ $RETVAL -eq 0 ] && touch /var/lock/subsys/linksysmon ;; stop) gprintf "Stopping linksysmon: " killproc linksysmon killall snmptrapd RETVAL=$? echo [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/linksysmon ;; status) status linksysmon RETVAL=$? ;; restart|reload) $0 stop $0 start RETVAL=$? ;; condrestart) [ -f /var/lock/subsys/linksysmon ] && restart RETVAL=$? ;; *) gprintf "Usage: %s {start|stop|status|restart|condrestart|reload}\n" "$0" exit 1 esac exit $RETVAL