aboutsummaryrefslogtreecommitdiff
path: root/sh/rc-functions.sh
diff options
context:
space:
mode:
Diffstat (limited to 'sh/rc-functions.sh')
-rwxr-xr-xsh/rc-functions.sh17
1 files changed, 11 insertions, 6 deletions
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
;;