aboutsummaryrefslogtreecommitdiff
path: root/sh
diff options
context:
space:
mode:
authorWilliam Hubbs <williamh@gentoo.org>2012-04-26 12:19:42 -0500
committerWilliam Hubbs <williamh@gentoo.org>2012-04-26 12:19:42 -0500
commit8d63719418de14248bb4bd3b4a0ce5599f8f3092 (patch)
tree8a95736ad5e756b0312240dea4fda80472fa7278 /sh
parent3967077da3901b4f10d71dec1ee977af36fae956 (diff)
Change the working directory for depend only
We already have a special case for depend processing, so we should change the working directory there only. This prevents us from forcing all init scripts to be run in the init directory.
Diffstat (limited to 'sh')
-rw-r--r--sh/runscript.sh.in9
1 files changed, 5 insertions, 4 deletions
diff --git a/sh/runscript.sh.in b/sh/runscript.sh.in
index a4d9e7cf..bc93b511 100644
--- a/sh/runscript.sh.in
+++ b/sh/runscript.sh.in
@@ -174,10 +174,6 @@ status()
yesno $RC_DEBUG && set -x
-# Enter the dir of the init script to fix the globbing with e.g. depend()
-# bug 412677
-cd ${RC_SERVICE%/*}
-
_conf_d=${RC_SERVICE%/*}/../conf.d
# If we're net.eth0 or openvpn.work then load net or openvpn config
_c=${RC_SVCNAME%%.*}
@@ -237,7 +233,12 @@ while [ -n "$1" ]; do
# Special case depend
if [ "$1" = depend ]; then
shift
+
+ # Enter the dir of the init script to fix the globbing
+ # bug 412677
+ cd ${RC_SERVICE%/*}
_depend
+ cd /
continue
fi
# See if we have the required function and run it