From 9aac569eaa031e27191a3f4165b389a17f467ad2 Mon Sep 17 00:00:00 2001 From: Doug Barton 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 --- www/lighttpd/files/lighttpd.in | 138 ++++++++++++++++++++++++++++++++++++++ www/lighttpd/files/lighttpd.sh.in | 138 -------------------------------------- 2 files changed, 138 insertions(+), 138 deletions(-) create mode 100644 www/lighttpd/files/lighttpd.in delete mode 100644 www/lighttpd/files/lighttpd.sh.in (limited to 'www/lighttpd/files') diff --git a/www/lighttpd/files/lighttpd.in b/www/lighttpd/files/lighttpd.in new file mode 100644 index 000000000000..b003ab57468a --- /dev/null +++ b/www/lighttpd/files/lighttpd.in @@ -0,0 +1,138 @@ +#!/bin/sh +# +# $FreeBSD$ +# +# PROVIDE: lighttpd +# REQUIRE: %%REQUIRE%% +# KEYWORD: shutdown +# +# Add the following lines to /etc/rc.conf to enable lighttpd: +# +# lighttpd_enable (bool): Set it to "YES" to enable lighttpd +# Default is "NO". +# lighttpd_conf (path): Set full path to configuration file. +# Default is "%%PREFIX%%/etc/lighttpd/lighttpd.conf". +# lighttpd_pidfile (path): Set full path to pid file. +# Default is "/var/run/lighttpd.pid". +# +# Add the following lines to /etc/rc.conf for multiple instances: +# (overrides lighttpd_conf and lighttpd_pidfile from above) +# +# lighttpd_instances (string): Instances of lighttpd +# Default is "" (no instances). +# lighttpd_${i}_conf (path): Set full path to instance configuration file. +# Default is "%%PREFIX%%/etc/lighttpd/${i}.conf". +# lighttpd_${i}_pidfile (path): Set full path to instance pid file +# Default is "/var/run/lighttpd_${i}.pid". +# + +. /etc/rc.subr + +name="lighttpd" +rcvar=lighttpd_enable + +load_rc_config $name + +: ${lighttpd_enable="NO"} +: ${lighttpd_pidfile="/var/run/${name}.pid"} + +# Compatibility for old configuration file location +deprecated_conf= +if [ -z "${lighttpd_conf}" ]; then + if [ -f "%%PREFIX%%/etc/lighttpd.conf" ]; then + deprecated_conf=1 + lighttpd_conf="%%PREFIX%%/etc/lighttpd.conf" + else + lighttpd_conf="%%PREFIX%%/etc/lighttpd/lighttpd.conf" + fi +fi + +command=%%PREFIX%%/sbin/lighttpd +stop_postcmd=stop_postcmd +restart_precmd="lighttpd_checkconfig" +graceful_precmd="lighttpd_checkconfig" +graceful_cmd="lighttpd_graceful" +gracefulstop_cmd="lighttpd_gracefulstop" +configtest_cmd="lighttpd_checkconfig" +extra_commands="reload graceful gracefulstop configtest" +command_args="-f ${lighttpd_conf}" +pidfile=${lighttpd_pidfile} +required_files=${lighttpd_conf} + +lighttpd_check_deprecated() +{ + if [ -n "${deprecated_conf}" ]; then + echo "" + echo "*** NOTICE: ***" + echo "The default location of %%PREFIX%%/etc/lighttpd.conf is deprecated" + echo "Please consider moving to %%PREFIX%%/etc/lighttpd/lighttpd.conf" + echo "" + fi +} + +lighttpd_checkconfig() +{ + echo "Performing sanity check on ${name} configuration:" + eval "${command} ${command_args} -t" +} + +lighttpd_gracefulstop() +{ + echo "Stopping ${name} gracefully." + sig_reload="INT" + run_rc_command reload +} + +lighttpd_graceful() +{ + lighttpd_gracefulstop + rm -f ${pidfile} + run_rc_command start +} + +lighttpd_run_instance() +{ + _i="$1" + _rcmd="$2" + name=${_orig_name}_${_i} + eval ${name}_enable=${lighttpd_enable} + eval lighttpd_conf=\"\${lighttpd_${_i}_conf:-"%%PREFIX%%/etc/lighttpd/${_i}.conf"}\" + eval lighttpd_pidfile=\"\${lighttpd_${_i}_pidfile:-"/var/run/lighttpd_${_i}.pid"}\" + command_args="-f ${lighttpd_conf}" + pidfile=${lighttpd_pidfile} + required_files=${lighttpd_conf} + run_rc_command ${_rcmd} +} + +stop_postcmd() +{ + rm -f ${pidfile} +} + +if [ -n "${lighttpd_instances}" ]; then + _orig_name="${name}" + _run_cmd="$1" + if [ $# -gt 0 ]; then + shift + fi + if [ -n "$*" ]; then + _run_instances="$*" + fi + if [ -n "${_run_instances}" ]; then + for _a in $_run_instances; do + for _in in ${lighttpd_instances}; do + if [ "$_a" = "$_in" ]; then + _runlist="${_runlist} ${_a}" + fi + done + done + else + _runlist="${lighttpd_instances}" + fi + for _in in ${_runlist}; do + lighttpd_run_instance $_in $_run_cmd + done +else + start_precmd="lighttpd_check_deprecated" + run_rc_command "$1" +fi diff --git a/www/lighttpd/files/lighttpd.sh.in b/www/lighttpd/files/lighttpd.sh.in deleted file mode 100644 index b003ab57468a..000000000000 --- a/www/lighttpd/files/lighttpd.sh.in +++ /dev/null @@ -1,138 +0,0 @@ -#!/bin/sh -# -# $FreeBSD$ -# -# PROVIDE: lighttpd -# REQUIRE: %%REQUIRE%% -# KEYWORD: shutdown -# -# Add the following lines to /etc/rc.conf to enable lighttpd: -# -# lighttpd_enable (bool): Set it to "YES" to enable lighttpd -# Default is "NO". -# lighttpd_conf (path): Set full path to configuration file. -# Default is "%%PREFIX%%/etc/lighttpd/lighttpd.conf". -# lighttpd_pidfile (path): Set full path to pid file. -# Default is "/var/run/lighttpd.pid". -# -# Add the following lines to /etc/rc.conf for multiple instances: -# (overrides lighttpd_conf and lighttpd_pidfile from above) -# -# lighttpd_instances (string): Instances of lighttpd -# Default is "" (no instances). -# lighttpd_${i}_conf (path): Set full path to instance configuration file. -# Default is "%%PREFIX%%/etc/lighttpd/${i}.conf". -# lighttpd_${i}_pidfile (path): Set full path to instance pid file -# Default is "/var/run/lighttpd_${i}.pid". -# - -. /etc/rc.subr - -name="lighttpd" -rcvar=lighttpd_enable - -load_rc_config $name - -: ${lighttpd_enable="NO"} -: ${lighttpd_pidfile="/var/run/${name}.pid"} - -# Compatibility for old configuration file location -deprecated_conf= -if [ -z "${lighttpd_conf}" ]; then - if [ -f "%%PREFIX%%/etc/lighttpd.conf" ]; then - deprecated_conf=1 - lighttpd_conf="%%PREFIX%%/etc/lighttpd.conf" - else - lighttpd_conf="%%PREFIX%%/etc/lighttpd/lighttpd.conf" - fi -fi - -command=%%PREFIX%%/sbin/lighttpd -stop_postcmd=stop_postcmd -restart_precmd="lighttpd_checkconfig" -graceful_precmd="lighttpd_checkconfig" -graceful_cmd="lighttpd_graceful" -gracefulstop_cmd="lighttpd_gracefulstop" -configtest_cmd="lighttpd_checkconfig" -extra_commands="reload graceful gracefulstop configtest" -command_args="-f ${lighttpd_conf}" -pidfile=${lighttpd_pidfile} -required_files=${lighttpd_conf} - -lighttpd_check_deprecated() -{ - if [ -n "${deprecated_conf}" ]; then - echo "" - echo "*** NOTICE: ***" - echo "The default location of %%PREFIX%%/etc/lighttpd.conf is deprecated" - echo "Please consider moving to %%PREFIX%%/etc/lighttpd/lighttpd.conf" - echo "" - fi -} - -lighttpd_checkconfig() -{ - echo "Performing sanity check on ${name} configuration:" - eval "${command} ${command_args} -t" -} - -lighttpd_gracefulstop() -{ - echo "Stopping ${name} gracefully." - sig_reload="INT" - run_rc_command reload -} - -lighttpd_graceful() -{ - lighttpd_gracefulstop - rm -f ${pidfile} - run_rc_command start -} - -lighttpd_run_instance() -{ - _i="$1" - _rcmd="$2" - name=${_orig_name}_${_i} - eval ${name}_enable=${lighttpd_enable} - eval lighttpd_conf=\"\${lighttpd_${_i}_conf:-"%%PREFIX%%/etc/lighttpd/${_i}.conf"}\" - eval lighttpd_pidfile=\"\${lighttpd_${_i}_pidfile:-"/var/run/lighttpd_${_i}.pid"}\" - command_args="-f ${lighttpd_conf}" - pidfile=${lighttpd_pidfile} - required_files=${lighttpd_conf} - run_rc_command ${_rcmd} -} - -stop_postcmd() -{ - rm -f ${pidfile} -} - -if [ -n "${lighttpd_instances}" ]; then - _orig_name="${name}" - _run_cmd="$1" - if [ $# -gt 0 ]; then - shift - fi - if [ -n "$*" ]; then - _run_instances="$*" - fi - if [ -n "${_run_instances}" ]; then - for _a in $_run_instances; do - for _in in ${lighttpd_instances}; do - if [ "$_a" = "$_in" ]; then - _runlist="${_runlist} ${_a}" - fi - done - done - else - _runlist="${lighttpd_instances}" - fi - for _in in ${_runlist}; do - lighttpd_run_instance $_in $_run_cmd - done -else - start_precmd="lighttpd_check_deprecated" - run_rc_command "$1" -fi -- cgit v1.2.3