aboutsummaryrefslogtreecommitdiff
path: root/sh
diff options
context:
space:
mode:
Diffstat (limited to 'sh')
-rw-r--r--sh/Makefile4
-rw-r--r--sh/functions.sh.in6
-rw-r--r--sh/gendepends.sh.in8
-rwxr-xr-xsh/net.sh4
-rw-r--r--sh/runscript.sh.in4
5 files changed, 13 insertions, 13 deletions
diff --git a/sh/Makefile b/sh/Makefile
index aae07a32..ad328027 100644
--- a/sh/Makefile
+++ b/sh/Makefile
@@ -13,7 +13,7 @@ include ${MK}/scripts.mk
_installafter:
${INSTALL} -d ${DESTDIR}/${PREFIX}/etc/init.d
@# Provide an init script for the loopback interface
- ln -snf ${RC_LIB}/sh/net.sh ${DESTDIR}/${PREFIX}/etc/init.d/${NET_LO} || exit $$?
+ ln -snf ${PREFIX}/${RC_LIB}/sh/net.sh ${DESTDIR}/${PREFIX}/etc/init.d/${NET_LO} || exit $$?
@# Put functions.sh into the init.d dir so 3rd party apps don't have to
@# be multilib aware
- ln -snf ${RC_LIB}/sh/functions.sh ${DESTDIR}/${PREFIX}/etc/init.d || exit $$?
+ ln -snf ${PREFIX}/${RC_LIB}/sh/functions.sh ${DESTDIR}/${PREFIX}/etc/init.d || exit $$?
diff --git a/sh/functions.sh.in b/sh/functions.sh.in
index 16e36963..b8d3c95d 100644
--- a/sh/functions.sh.in
+++ b/sh/functions.sh.in
@@ -43,8 +43,8 @@ _sanitize_path()
local IFS=":" p= path=
for p in ${PATH}; do
case "${p}" in
- @PREFIX@/lib/rc/sbin|/bin|/sbin|/usr/bin|/usr/sbin|@PKG_PREFIX@/bin|@PKG_PREFIX@/sbin);;
- *) path="${path}:${p}";;
+ @PREFIX@/lib/rc/sbin|@PREFIX@/bin|@PREFIX@/sbin|/usr/bin|/usr/sbin|@PKG_PREFIX@/bin|@PKG_PREFIX@/sbin);;
+ *) path="${path}${path:+:}${p}";;
esac
done
@@ -60,7 +60,7 @@ if [ -n "${ZSH_VERSION}" ]; then
fi
# Add our bin to $PATH
-export PATH="@PREFIX@/lib/rc/bin:/bin:/sbin:/usr/bin:/usr/sbin:@PKG_PREFIX@/bin:@PKG_PREFIX@/sbin:$(_sanitize_path "${PATH}")"
+export PATH="@PREFIX@/lib/rc/bin:@PREFIX@/bin:@PREFIX@/sbin:/usr/bin:/usr/sbin:@PKG_PREFIX@/bin:@PKG_PREFIX@/sbin:$(_sanitize_path "${PATH}")"
unset _sanitize_path
for arg; do
diff --git a/sh/gendepends.sh.in b/sh/gendepends.sh.in
index 8e30a648..fad7665c 100644
--- a/sh/gendepends.sh.in
+++ b/sh/gendepends.sh.in
@@ -4,7 +4,7 @@
# Copyright 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
-. /etc/init.d/functions.sh
+. @PREFIX@/etc/init.d/functions.sh
config() {
[ -n "$*" ] && echo "${SVCNAME} config $*" >&3
@@ -31,7 +31,7 @@ depend() {
:
}
-for _dir in /etc/init.d /usr/local/etc/init.d; do
+for _dir in @PREFIX@/etc/init.d @PKG_PREFIX@/etc/init.d; do
[ -d "${_dir}" ] || continue
cd "${_dir}"
for SVCNAME in *; do
@@ -39,7 +39,7 @@ for _dir in /etc/init.d /usr/local/etc/init.d; do
# Only generate dependencies for runscripts
read one two < "${SVCNAME}"
- [ "${one}" = "#!/sbin/runscript" ] || continue
+ [ "${one}" = "#!@PREFIX@/sbin/runscript" ] || continue
unset one two
export SVCNAME=${SVCNAME##*/}
@@ -59,7 +59,7 @@ for _dir in /etc/init.d /usr/local/etc/init.d; do
. "${_dir}/../conf.d/${SVCNAME}"
fi
- [ -e /etc/rc.conf ] && . /etc/rc.conf
+ [ -e @PREFIX@/etc/rc.conf ] && . @PREFIX@/etc/rc.conf
if . "${_dir}/${SVCNAME}"; then
echo "${SVCNAME}" >&3
diff --git a/sh/net.sh b/sh/net.sh
index acf8dba7..1fe52f19 100755
--- a/sh/net.sh
+++ b/sh/net.sh
@@ -1,4 +1,4 @@
-#!/sbin/runscript
+#!@PREFIX@/sbin/runscript
# Copyright 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
@@ -21,7 +21,7 @@ depend()
need localmount
after bootmisc
provide net
- keyword nojail
+ keyword nojail noprefix
case "${IFACE}" in
lo|lo0);;
diff --git a/sh/runscript.sh.in b/sh/runscript.sh.in
index 6b8c3db2..df50e881 100644
--- a/sh/runscript.sh.in
+++ b/sh/runscript.sh.in
@@ -4,7 +4,7 @@
# Copyright 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
-. /etc/init.d/functions.sh
+. @PREFIX@/etc/init.d/functions.sh
. "${RC_LIBDIR}"/sh/rc-functions.sh
# Support LiveCD foo
@@ -59,7 +59,7 @@ elif [ -e "/etc/conf.d/${SVCNAME}" ]; then
fi
# Load any system overrides
-[ -e /etc/rc.conf ] && . /etc/rc.conf
+[ -e @PREFIX@/etc/rc.conf ] && . @PREFIX@/etc/rc.conf
# Apply any ulimit defined
[ -n "${rc_ulimit:-${RC_ULIMIT}}" ] && ulimit ${rc_ulimit:-${RC_ULIMIT}}