From f0d9f58b7f1825fb95236f427a6400ad54ad4b5e Mon Sep 17 00:00:00 2001 From: dougb Date: Sun, 5 Aug 2012 23:19:36 +0000 Subject: Move the rc.d scripts of the form *.sh.in to *.in Where necessary add $FreeBSD$ to the file No PORTREVISION bump necessary because this is a no-op --- net-mgmt/net-snmp/Makefile | 2 +- net-mgmt/net-snmp/files/snmpd.in | 65 +++++++++++++++++++++++++++++++++ net-mgmt/net-snmp/files/snmpd.sh.in | 65 --------------------------------- net-mgmt/net-snmp/files/snmptrapd.in | 34 +++++++++++++++++ net-mgmt/net-snmp/files/snmptrapd.sh.in | 34 ----------------- 5 files changed, 100 insertions(+), 100 deletions(-) create mode 100644 net-mgmt/net-snmp/files/snmpd.in delete mode 100644 net-mgmt/net-snmp/files/snmpd.sh.in create mode 100644 net-mgmt/net-snmp/files/snmptrapd.in delete mode 100644 net-mgmt/net-snmp/files/snmptrapd.sh.in (limited to 'net-mgmt/net-snmp') diff --git a/net-mgmt/net-snmp/Makefile b/net-mgmt/net-snmp/Makefile index 9acb5fc722c6..4e76bd296cef 100644 --- a/net-mgmt/net-snmp/Makefile +++ b/net-mgmt/net-snmp/Makefile @@ -35,7 +35,7 @@ OPTIONS= IPV6 "Build with IPv6 support" on \ MAKE_JOBS_UNSAFE= yes GNU_CONFIGURE= yes -USE_RC_SUBR= snmpd.sh snmptrapd.sh +USE_RC_SUBR= snmpd snmptrapd USE_OPENSSL= yes USE_LDCONFIG= yes WANT_PERL= yes diff --git a/net-mgmt/net-snmp/files/snmpd.in b/net-mgmt/net-snmp/files/snmpd.in new file mode 100644 index 000000000000..83d0c08efa29 --- /dev/null +++ b/net-mgmt/net-snmp/files/snmpd.in @@ -0,0 +1,65 @@ +#!/bin/sh + +# $FreeBSD$ +# +# PROVIDE: snmpd +# REQUIRE: DAEMON +# +# Add the following line to /etc/rc.conf to enable snmpd: +# +# snmpd_enable="YES" +# snmpd_flags="" +# snmpd_conffile="" + +. /etc/rc.subr + +name=snmpd +rcvar=snmpd_enable + +load_rc_config snmpd + +snmpd_enable=${snmpd_enable:-"NO"} +snmpd_flush_cache=${snmpd_flush_cache-"NO"} + +pidfile=${snmpd_pidfile:-"/var/run/net_snmpd.pid"} + +command=%%PREFIX%%/sbin/${name} + +start_precmd=net_snmpd_precmd + +net_snmpd_precmd () { + local flag conffile snmpd_conffile_set + + if checkyesno snmpd_flush_cache; then + rm -vf /var/net-snmp/.snmp-exec-cache + fi + + for flag in ${snmpd_flags}; do + case "${flag}" in + -p*) + err 1 "\$snmpd_flags includes -p option." \ + "Please use \$snmpd_pidfile instead." + ;; + -c*) + err 1 "\$snmpd_flags includes -c option." \ + "Please use \$snmpd_conffile instead." + ;; + esac + done + + for conffile in ${snmpd_conffile}; do + if [ -f "${conffile}" -a -s "${conffile}" ]; then + snmpd_conffile_set="${snmpd_conffile_set},${conffile}" + else + err 1 "snmpd configuration file $conffile not found." + fi + done + + # snmpd syntax requires that the listening address (if defined) be the last argument + if [ -n "${snmpd_conffile_set}" ]; then + rc_flags="-c ${snmpd_conffile_set#,} ${rc_flags}" + fi + rc_flags="-p ${pidfile} ${rc_flags}" +} + +run_rc_command "$1" diff --git a/net-mgmt/net-snmp/files/snmpd.sh.in b/net-mgmt/net-snmp/files/snmpd.sh.in deleted file mode 100644 index 83d0c08efa29..000000000000 --- a/net-mgmt/net-snmp/files/snmpd.sh.in +++ /dev/null @@ -1,65 +0,0 @@ -#!/bin/sh - -# $FreeBSD$ -# -# PROVIDE: snmpd -# REQUIRE: DAEMON -# -# Add the following line to /etc/rc.conf to enable snmpd: -# -# snmpd_enable="YES" -# snmpd_flags="" -# snmpd_conffile="" - -. /etc/rc.subr - -name=snmpd -rcvar=snmpd_enable - -load_rc_config snmpd - -snmpd_enable=${snmpd_enable:-"NO"} -snmpd_flush_cache=${snmpd_flush_cache-"NO"} - -pidfile=${snmpd_pidfile:-"/var/run/net_snmpd.pid"} - -command=%%PREFIX%%/sbin/${name} - -start_precmd=net_snmpd_precmd - -net_snmpd_precmd () { - local flag conffile snmpd_conffile_set - - if checkyesno snmpd_flush_cache; then - rm -vf /var/net-snmp/.snmp-exec-cache - fi - - for flag in ${snmpd_flags}; do - case "${flag}" in - -p*) - err 1 "\$snmpd_flags includes -p option." \ - "Please use \$snmpd_pidfile instead." - ;; - -c*) - err 1 "\$snmpd_flags includes -c option." \ - "Please use \$snmpd_conffile instead." - ;; - esac - done - - for conffile in ${snmpd_conffile}; do - if [ -f "${conffile}" -a -s "${conffile}" ]; then - snmpd_conffile_set="${snmpd_conffile_set},${conffile}" - else - err 1 "snmpd configuration file $conffile not found." - fi - done - - # snmpd syntax requires that the listening address (if defined) be the last argument - if [ -n "${snmpd_conffile_set}" ]; then - rc_flags="-c ${snmpd_conffile_set#,} ${rc_flags}" - fi - rc_flags="-p ${pidfile} ${rc_flags}" -} - -run_rc_command "$1" diff --git a/net-mgmt/net-snmp/files/snmptrapd.in b/net-mgmt/net-snmp/files/snmptrapd.in new file mode 100644 index 000000000000..ac77e1c1fa49 --- /dev/null +++ b/net-mgmt/net-snmp/files/snmptrapd.in @@ -0,0 +1,34 @@ +#!/bin/sh +# +# $FreeBSD$ +# +# PROVIDE: snmptrapd +# REQUIRE: DAEMON +# +# Add the following line to /etc/rc.conf to enable snmptrapd: +# +# snmptrapd_enable="YES" +# + +snmptrapd_enable=${snmptrapd_enable-"NO"} +snmptrapd_flags=${snmptrapd_flags-"-p /var/run/snmptrapd.pid"} + +. /etc/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=snmptrapd_enable + +command=%%PREFIX%%/sbin/${name} +pidfile=/var/run/${name}.pid + +load_rc_config ${name} +run_rc_command "$1" diff --git a/net-mgmt/net-snmp/files/snmptrapd.sh.in b/net-mgmt/net-snmp/files/snmptrapd.sh.in deleted file mode 100644 index ac77e1c1fa49..000000000000 --- a/net-mgmt/net-snmp/files/snmptrapd.sh.in +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh -# -# $FreeBSD$ -# -# PROVIDE: snmptrapd -# REQUIRE: DAEMON -# -# Add the following line to /etc/rc.conf to enable snmptrapd: -# -# snmptrapd_enable="YES" -# - -snmptrapd_enable=${snmptrapd_enable-"NO"} -snmptrapd_flags=${snmptrapd_flags-"-p /var/run/snmptrapd.pid"} - -. /etc/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=snmptrapd_enable - -command=%%PREFIX%%/sbin/${name} -pidfile=/var/run/${name}.pid - -load_rc_config ${name} -run_rc_command "$1" -- cgit