diff options
author | Roy Marples <roy@marples.name> | 2007-09-19 13:53:40 +0000 |
---|---|---|
committer | Roy Marples <roy@marples.name> | 2007-09-19 13:53:40 +0000 |
commit | 77f9015f0bf09c5ef3c51009e21d8e687006c3e4 (patch) | |
tree | 5f62c36e8a9e3c3dddeef6a086a0708af35dfcd3 /sh | |
parent | 987c72f12f41b8108447810fe84fd9f16e6d29d7 (diff) |
/lib/rcscripts -> /lib/rc
Diffstat (limited to 'sh')
-rw-r--r-- | sh/Makefile | 2 | ||||
-rw-r--r-- | sh/functions.sh | 6 | ||||
-rwxr-xr-x | sh/rc-functions.sh | 17 |
3 files changed, 15 insertions, 10 deletions
diff --git a/sh/Makefile b/sh/Makefile index ac50fa90..aa9a4b45 100644 --- a/sh/Makefile +++ b/sh/Makefile @@ -1,4 +1,4 @@ -DIR = /$(LIB)/rcscripts/sh +DIR = $(RC_LIB)/sh FILES = functions.sh init-functions.sh init-common-post.sh \ rc-functions.sh rc-mount.sh EXES = gendepends.sh net.sh rc-mount.sh rc-help.sh runscript.sh diff --git a/sh/functions.sh b/sh/functions.sh index 5b4f8d91..495f2bd1 100644 --- a/sh/functions.sh +++ b/sh/functions.sh @@ -113,9 +113,9 @@ fi # This should solve both /sbin and /usr/sbin not present when # doing 'su -c foo', or for something like: PATH= rcscript start case "${PATH}" in - /lib/rcscripts/bin:/bin:/sbin:/usr/bin:/usr/sbin) ;; - /lib/rcscripts/bin:/bin:/sbin:/usr/bin:/usr/sbin:*) ;; - *) export PATH="/lib/rcscripts/bin:/bin:/sbin:/usr/bin:/usr/sbin:${PATH}" ;; + /lib/rc/bin:/bin:/sbin:/usr/bin:/usr/sbin) ;; + /lib/rc/bin:/bin:/sbin:/usr/bin:/usr/sbin:*) ;; + *) export PATH="/lib/rc/bin:/bin:/sbin:/usr/bin:/usr/sbin:${PATH}" ;; esac for arg in "$@" ; do diff --git a/sh/rc-functions.sh b/sh/rc-functions.sh index a1a7644b..79f479fc 100755 --- a/sh/rc-functions.sh +++ b/sh/rc-functions.sh @@ -2,12 +2,17 @@ # Distributed under the terms of the GNU General Public License v2 has_addon() { - [ -e "${RC_LIBDIR}/addons/$1.sh" ] + [ -e "${RC_LIBDIR}/addons/$1.sh" ] || [ -e /lib/rcscripts/addons/"$1".sh ] } import_addon() { - has_addon "$1" || return 1 - . "${RC_LIBDIR}/addons/$1.sh" + if [ -e "${RC_LIBDIR}/addons/$1.sh" ]; then + . "${RC_LIBDIR}/addons/$1.sh" + elif [ -e /lib/rcscripts/addons/"$1".sh ]; then + . /lib/rcscripts/addons/"$1".sh + else + return 1 + fi } start_addon() { @@ -22,7 +27,7 @@ is_net_fs() { [ -z "$1" ] && return 1 local t=$(mountinfo --fstype "$1") - for x in ${RC_NET_FS_LIST} ; do + for x in ${RC_NET_FS_LIST}; do [ "${x}" = "${t}" ] && return 0 done return 1 @@ -38,12 +43,12 @@ get_bootparam() { [ -z "${match}" -o ! -r /proc/cmdline ] && return 1 set -- $(cat /proc/cmdline) - while [ -n "$1" ] ; do + while [ -n "$1" ]; do case "$1" in gentoo=*) local params="${1##*=}" local IFS=, x= - for x in ${params} ; do + for x in ${params}; do [ "${x}" = "${match}" ] && return 0 done ;; |