/lib/rcscripts -> /lib/rc

This commit is contained in:
Roy Marples
2007-09-19 13:53:40 +00:00
parent 987c72f12f
commit 77f9015f0b
14 changed files with 46 additions and 30 deletions

View File

@@ -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
;;