diff options
author | hubertf <hubertf> | 2000-12-16 09:04:40 +0000 |
---|---|---|
committer | hubertf <hubertf> | 2000-12-16 09:04:40 +0000 |
commit | f76e46d0e6be5f0ab696df85b2b0fe67c52b1477 (patch) | |
tree | 151cf1db7b5004788a523c30cc759f9822a439d4 | |
parent | 055ee63baa1f3ee46b3551f03efb4830760de99a (diff) | |
download | pkgsrc-f76e46d0e6be5f0ab696df85b2b0fe67c52b1477.tar.gz |
Make rc.d script handle stop/start/restart
-rw-r--r-- | net/ucd-snmp/Makefile | 10 | ||||
-rw-r--r-- | net/ucd-snmp/files/snmpd.sh | 34 |
2 files changed, 32 insertions, 12 deletions
diff --git a/net/ucd-snmp/Makefile b/net/ucd-snmp/Makefile index 166e9dc2e8d..c22abb9af49 100644 --- a/net/ucd-snmp/Makefile +++ b/net/ucd-snmp/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.24 2000/12/04 11:48:23 itojun Exp $ +# $NetBSD: Makefile,v 1.25 2000/12/16 09:04:40 hubertf Exp $ # FreeBSD Id: Makefile,v 1.18 1998/04/06 20:50:31 andreas Exp # @@ -45,14 +45,12 @@ post-extract: pre-configure: @(cd ${WRKSRC} && autoreconf) -post-build: - @${SED} -e 's,@PREFIX@,${PREFIX},' \ - < ${FILESDIR}/snmpd.sh > ${WRKDIR}/snmpd.sh - post-install: - @${MKDIR} ${PREFIX}/share/examples/ucd-snmp + ${MKDIR} ${PREFIX}/share/examples/ucd-snmp ${INSTALL_DATA} ${WRKSRC}/EXAMPLE.conf ${PREFIX}/share/examples/ucd-snmp ${INSTALL_DATA_DIR} ${PREFIX}/lib/snmp/dlmod + ${SED} -e 's,@PREFIX@,${PREFIX},' \ + < ${FILESDIR}/snmpd.sh > ${WRKDIR}/snmpd.sh ${INSTALL_SCRIPT} ${WRKDIR}/snmpd.sh ${PREFIX}/etc/rc.d .if (${OPSYS} == "NetBSD") 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 + |