aboutsummaryrefslogtreecommitdiff
path: root/sh/gendepends.sh
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2007-12-14 12:24:16 +0000
committerRoy Marples <roy@marples.name>2007-12-14 12:24:16 +0000
commita3db3bac6242ff29871161620d0449125b3262aa (patch)
treea4b6d7f9cefb59dd5955a88a474d1484d82c2fb6 /sh/gendepends.sh
parentb73bd04cf3f19b47480c85dd58e63eef5900fa3c (diff)
Allow services to be in /usr/local/etc/init.d, but disallow them being added to the boot runlevel.
Diffstat (limited to 'sh/gendepends.sh')
-rwxr-xr-xsh/gendepends.sh63
1 files changed, 33 insertions, 30 deletions
diff --git a/sh/gendepends.sh b/sh/gendepends.sh
index 4fb2c8ed..f6c6edb4 100755
--- a/sh/gendepends.sh
+++ b/sh/gendepends.sh
@@ -53,42 +53,45 @@ depend() {
:
}
-cd /etc/init.d
-for SVCNAME in *; do
- [ -x "${SVCNAME}" ] || continue
+for _dir in /etc/init.d /usr/local/etc/init.d; do
+ [ -d "${_dir}" ] || continue
+ cd "${_dir}"
+ for SVCNAME in *; do
+ [ -x "${SVCNAME}" ] || continue
- # Only generate dependencies for runscripts
- read one two < "${SVCNAME}"
- [ "${one}" = "#!/sbin/runscript" ] || continue
- unset one two
+ # Only generate dependencies for runscripts
+ read one two < "${SVCNAME}"
+ [ "${one}" = "#!/sbin/runscript" ] || continue
+ unset one two
- SVCNAME=${SVCNAME##*/}
- (
- # Save stdout in fd3, then remap it to stderr
- exec 3>&1 1>&2
+ SVCNAME=${SVCNAME##*/}
+ (
+ # Save stdout in fd3, then remap it to stderr
+ exec 3>&1 1>&2
- rc_c=${SVCNAME%%.*}
- if [ -n "${rc_c}" -a "${rc_c}" != "${SVCNAME}" ]; then
- [ -e /etc/conf.d/"${rc_c}" ] && . /etc/conf.d/"${rc_c}"
- fi
- unset rc_c
+ _rc_c=${SVCNAME%%.*}
+ if [ -n "${_rc_c}" -a "${_rc_c}" != "${SVCNAME}" ]; then
+ [ -e "${_dir}/../conf.d/${_rc_c}" ] && . "${_dir}/../conf.d/${_rc_c}"
+ fi
+ unset _rc_c
- [ -e /etc/conf.d/"${SVCNAME}" ] && . /etc/conf.d/"${SVCNAME}"
+ [ -e "${_dir}/../conf.d/${SVCNAME}" ] && . "${_dir}/../conf.d/${SVCNAME}"
- if . /etc/init.d/"${SVCNAME}"; then
- echo "${SVCNAME}" >&3
- depend
+ if . "${_dir}/${SVCNAME}"; then
+ echo "${SVCNAME}" >&3
+ depend
- # Add any user defined depends
- config ${rc_config} ${RC_CONFIG}
- need ${rc_need} ${RC_NEED}
- use ${rc_use} ${RC_USE}
- before ${rc_before} ${RC_BEFORE}
- after ${rc_after} ${RC_AFTER}
- provide ${rc_provide} ${RC_PROVIDE}
- keywords ${rc_keywords} ${RC_KEYWORDS}
- fi
- )
+ # Add any user defined depends
+ config ${rc_config} ${RC_CONFIG}
+ need ${rc_need} ${RC_NEED}
+ use ${rc_use} ${RC_USE}
+ before ${rc_before} ${RC_BEFORE}
+ after ${rc_after} ${RC_AFTER}
+ provide ${rc_provide} ${RC_PROVIDE}
+ keywords ${rc_keywords} ${RC_KEYWORDS}
+ fi
+ )
+ done
done
# vim: set ts=4 :