summaryrefslogtreecommitdiff
path: root/net-mgmt/net-snmp/files/snmptrapd.sh.sample
diff options
context:
space:
mode:
authorJun Kuriyama <kuriyama@FreeBSD.org>2004-03-10 13:40:41 +0000
committerJun Kuriyama <kuriyama@FreeBSD.org>2004-03-10 13:40:41 +0000
commitef7f2d6bba55bb9fb1d0ff03420c07b0c048ee54 (patch)
tree952e0fb8a1543185f790d3580ff753f8799f1fe0 /net-mgmt/net-snmp/files/snmptrapd.sh.sample
parent- Update MAINTAINER-line of my ports to new @FreeBSD.org address (diff)
Various fixes / improvements.
See PR for details. PR: ports/63759 Submitted by: Cyrille Lefevre <cyrille.lefevre@laposte.net>
Diffstat (limited to 'net-mgmt/net-snmp/files/snmptrapd.sh.sample')
-rw-r--r--net-mgmt/net-snmp/files/snmptrapd.sh.sample35
1 files changed, 35 insertions, 0 deletions
diff --git a/net-mgmt/net-snmp/files/snmptrapd.sh.sample b/net-mgmt/net-snmp/files/snmptrapd.sh.sample
new file mode 100644
index 000000000000..760c260ccfe4
--- /dev/null
+++ b/net-mgmt/net-snmp/files/snmptrapd.sh.sample
@@ -0,0 +1,35 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+# PROVIDE: snmptrapd
+# REQUIRE: DAEMON
+# KEYWORD: FreeBSD
+#
+# Add the following line to /etc/rc.conf to enable snmptrapd:
+#
+# snmptrapd_enable="YES"
+#
+
+snmptrapd_enable="NO"
+snmptrapd_flags="-p /var/run/snmptrapd.pid"
+
+. %%RC_SUBR%%
+
+load_rc_config net_snmptrapd
+
+if [ ! -z "$net_snmptrapd_enable" ]; then
+ echo "Warning: \$net_snmptrapd_enable is obsoleted."
+ echo " Use \$snmptrapd_enable instead."
+ snmptrapd_enable="$net_snmptrapd_enable"
+ [ ! -z "$net_snmptrapd_flags" ] && snmptrapd_flags="$net_snmptrapd_flags"
+fi
+
+name=snmptrapd
+rcvar=`set_rcvar`
+
+command=%%PREFIX%%/sbin/${name}
+pidfile=/var/run/${name}.pid
+
+load_rc_config ${name}
+run_rc_command "$1"