summaryrefslogtreecommitdiff
path: root/sh/runscript.sh.in
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-03-03 10:33:42 +0000
committerRoy Marples <roy@marples.name>2008-03-03 10:33:42 +0000
commit0aedc0286040b595119b4523d38ffd35b0018d6c (patch)
tree32ab5aca002067f07bbc45fcd34a3fd769c73468 /sh/runscript.sh.in
parent5971d14afd7e67b088307cd589f84491e99625ed (diff)
downloadopenrc-0aedc0286040b595119b4523d38ffd35b0018d6c.tar.gz
openrc-0aedc0286040b595119b4523d38ffd35b0018d6c.tar.bz2
openrc-0aedc0286040b595119b4523d38ffd35b0018d6c.tar.xz
Introduce LOCAL_PREFIX for a user maintained script location.
Diffstat (limited to 'sh/runscript.sh.in')
-rw-r--r--sh/runscript.sh.in18
1 files changed, 10 insertions, 8 deletions
diff --git a/sh/runscript.sh.in b/sh/runscript.sh.in
index df50e88..bf8489e 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