aboutsummaryrefslogtreecommitdiffstats
path: root/net-mgmt/net-snmp-devel
diff options
context:
space:
mode:
authornork <nork@FreeBSD.org>2006-09-23 19:31:09 +0800
committernork <nork@FreeBSD.org>2006-09-23 19:31:09 +0800
commit5fe1d50a88aa75f42db9bdb59c7038cd6bf3bc2f (patch)
tree7dc4950c86442ae6f58ad52a48c9c396bc4d523c /net-mgmt/net-snmp-devel
parentaa6777bb1594cbee29b4b1e55749601133d60c29 (diff)
downloadfreebsd-ports-gnome-5fe1d50a88aa75f42db9bdb59c7038cd6bf3bc2f.tar.gz
freebsd-ports-gnome-5fe1d50a88aa75f42db9bdb59c7038cd6bf3bc2f.tar.zst
freebsd-ports-gnome-5fe1d50a88aa75f42db9bdb59c7038cd6bf3bc2f.zip
Add support snmpd_pidfile and snmpd_conffile on rcNG script.
Requested by: nyan, TAKANO Yuji <takachan@running-dog.net> Approved by: kuriyama
Diffstat (limited to 'net-mgmt/net-snmp-devel')
-rw-r--r--net-mgmt/net-snmp-devel/Makefile2
-rw-r--r--net-mgmt/net-snmp-devel/files/snmpd.sh.in31
2 files changed, 29 insertions, 4 deletions
diff --git a/net-mgmt/net-snmp-devel/Makefile b/net-mgmt/net-snmp-devel/Makefile
index 9c859d8bef59..49814d88b016 100644
--- a/net-mgmt/net-snmp-devel/Makefile
+++ b/net-mgmt/net-snmp-devel/Makefile
@@ -7,7 +7,7 @@
PORTNAME= snmp
PORTVERSION= 5.2.3
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= net-mgmt ipv6
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= net-snmp
diff --git a/net-mgmt/net-snmp-devel/files/snmpd.sh.in b/net-mgmt/net-snmp-devel/files/snmpd.sh.in
index 602a0b28bb50..11648059a77d 100644
--- a/net-mgmt/net-snmp-devel/files/snmpd.sh.in
+++ b/net-mgmt/net-snmp-devel/files/snmpd.sh.in
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# $FreeBSD: /tmp/pcvs/ports/net-mgmt/net-snmp-devel/files/Attic/snmpd.sh.in,v 1.2 2006-07-19 16:18:40 dougb Exp $
+# $FreeBSD: /tmp/pcvs/ports/net-mgmt/net-snmp-devel/files/Attic/snmpd.sh.in,v 1.3 2006-09-23 11:31:09 nork Exp $
#
# PROVIDE: snmpd
# REQUIRE: DAEMON
@@ -11,7 +11,9 @@
#
snmpd_enable=${snmpd_enable-"NO"}
-snmpd_flags=${snmpd_flags-"-p /var/run/snmpd.pid"}
+snmpd_flags=${snmpd_flags-""}
+snmpd_pidfile=${snmpd_pidfile-"/var/run/snmpd.pid"}
+snmpd_conffile=${snmpd_conffile-""}
. %%RC_SUBR%%
@@ -28,8 +30,31 @@ name=snmpd
rcvar=`set_rcvar`
command=%%PREFIX%%/sbin/${name}
-pidfile=/var/run/${name}.pid
+pidfile=${snmpd_pidfile}
sig_stop=KILL
load_rc_config ${name}
+
+case "${snmpd_flags}" in
+*-p\ *)
+ echo "Warning: \$snmpd_flags includes -p option." \
+ "Please use \$snmpd_pidfile instead."
+ ;;
+*)
+ snmpd_flags="-p ${snmpd_pidfile} ${snmpd_flags}"
+ ;;
+esac
+
+case "${snmpd_flags}" in
+*-c\ *)
+ echo "Warning: \$snmpd_flags includes -c option." \
+ "Please use \$snmpd_conffile instead."
+ ;;
+*)
+ if [ ! -z ${snmpd_conffile} -a -f ${snmpd_conffile} ]; then
+ snmpd_flags="-c ${snmpd_conffile} ${snmpd_flags}"
+ fi
+ ;;
+esac
+
run_rc_command "$1"