diff options
Diffstat (limited to 'net/ucd-snmp/files/snmpd.sh')
-rw-r--r-- | net/ucd-snmp/files/snmpd.sh | 34 |
1 files changed, 28 insertions, 6 deletions
diff --git a/net/ucd-snmp/files/snmpd.sh b/net/ucd-snmp/files/snmpd.sh index b9f32265c30..ea15c553802 100644 --- a/net/ucd-snmp/files/snmpd.sh +++ b/net/ucd-snmp/files/snmpd.sh @@ -1,13 +1,35 @@ #!/bin/sh -# $NetBSD: snmpd.sh,v 1.1 2000/10/13 18:16:00 kim Exp $ +# $NetBSD: snmpd.sh,v 1.2 2000/12/16 09:04:41 hubertf Exp $ + +# PID file: +PF=/var/run/snmpd.pid + if [ -f /etc/snmp/snmpd.conf ] then SNMPD_CFG="-c /etc/snmp/snmpd.conf" fi -if [ -x @PREFIX@/sbin/snmpd ] -then - echo -n ' snmpd' - @PREFIX@/sbin/snmpd -s -P /var/run/snmpd.pid -A -l /dev/null ${SNMPD_CFG} -fi +case $1 in +start) + if [ -x @PREFIX@/sbin/snmpd ] + then + echo -n ' snmpd' + @PREFIX@/sbin/snmpd -s -P ${PF} -A -l /dev/null ${SNMPD_CFG} + fi + ;; +stop) + if [ -f ${PF} ]; then + kill `cat ${PF}` + rm -f ${PF} + fi + ;; +restart) + sh $0 stop + sh $0 start + ;; +*) + echo "Usage: $0 {start|stop|restart}" + exit 1 +esac + |