From 0aedc0286040b595119b4523d38ffd35b0018d6c Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Mon, 3 Mar 2008 10:33:42 +0000 Subject: Introduce LOCAL_PREFIX for a user maintained script location. --- sh/gendepends.sh.in | 15 ++++++++++++++- sh/runscript.sh.in | 18 ++++++++++-------- 2 files changed, 24 insertions(+), 9 deletions(-) (limited to 'sh') diff --git a/sh/gendepends.sh.in b/sh/gendepends.sh.in index fad7665c..2beba641 100644 --- a/sh/gendepends.sh.in +++ b/sh/gendepends.sh.in @@ -31,8 +31,21 @@ depend() { : } -for _dir in @PREFIX@/etc/init.d @PKG_PREFIX@/etc/init.d; do +_done_dirs= +for _dir in \ +@PREFIX@/etc/init.d \ +@PKG_PREFIX@/etc/init.d \ +@LOCAL_PREFIX@/etc/init.d +do [ -d "${_dir}" ] || continue + + # Don't do the same dir twice + for _d in ${_done_dirs}; do + [ "${_d}" = "${_dir}" ] && continue 2 + done + unset _d + _done_dirs="${_done_dirs} ${_dir}" + cd "${_dir}" for SVCNAME in *; do [ -x "${SVCNAME}" ] || continue diff --git a/sh/runscript.sh.in b/sh/runscript.sh.in index df50e881..bf8489e3 100644 --- a/sh/runscript.sh.in +++ b/sh/runscript.sh.in @@ -40,23 +40,25 @@ describe() yesno ${RC_DEBUG} && set -x +_conf_d=${1%/*}/../conf.d # If we're net.eth0 or openvpn.work then load net or openvpn config _c=${SVCNAME%%.*} if [ -n "${_c}" -a "${_c}" != "${SVCNAME}" ]; then - if [ -e "/etc/conf.d/${_c}.${RC_SOFTLEVEL}" ]; then - . "/etc/conf.d/${_c}.${RC_SOFTLEVEL}" - elif [ -e "/etc/conf.d/${_c}" ]; then - . "/etc/conf.d/${_c}" + if [ -e "${_conf_d}/${_c}.${RC_SOFTLEVEL}" ]; then + . "${_conf_d}/${_c}.${RC_SOFTLEVEL}" + elif [ -e "${_conf_d}/${_c}" ]; then + . "${_conf_d}//${_c}" fi fi unset _c # Overlay with our specific config -if [ -e "/etc/conf.d/${SVCNAME}.${RC_SOFTLEVEL}" ]; then - . "/etc/conf.d/${SVCNAME}.${RC_SOFTLEVEL}" -elif [ -e "/etc/conf.d/${SVCNAME}" ]; then - . "/etc/conf.d/${SVCNAME}" +if [ -e "${_conf_d}/${SVCNAME}.${RC_SOFTLEVEL}" ]; then + . "${_conf_d}/${SVCNAME}.${RC_SOFTLEVEL}" +elif [ -e "${_conf_d}/${SVCNAME}" ]; then + . "${_conf_d}/${SVCNAME}" fi +unset _conf_d # Load any system overrides [ -e @PREFIX@/etc/rc.conf ] && . @PREFIX@/etc/rc.conf -- cgit v1.2.3