aboutsummaryrefslogtreecommitdiff
path: root/init.d.Linux/modules
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2007-04-11 15:00:22 +0000
committerRoy Marples <roy@marples.name>2007-04-11 15:00:22 +0000
commit33d303f1844d98490bb24071e612bf5845c5eebb (patch)
tree6551838f0c72fefbc5e19cd24069c256c05883c1 /init.d.Linux/modules
parentaff7b02dcebd268539cd440d608c6d8e51e62263 (diff)
Fix the modules init script
Diffstat (limited to 'init.d.Linux/modules')
-rwxr-xr-xinit.d.Linux/modules17
1 files changed, 6 insertions, 11 deletions
diff --git a/init.d.Linux/modules b/init.d.Linux/modules
index feda2c24..090bd7c9 100755
--- a/init.d.Linux/modules
+++ b/init.d.Linux/modules
@@ -13,25 +13,20 @@ load_modules() {
[ -z "${config}" -o ! -r "${config}" ] && return 0
- modules=$(sed -e 's:#.*::' -e '/^[[:space:]]*$/d' "${config}")
- [ -z "${modules}" ] && return 0
+ eval set -- $(sed -e 's:#.*::' -e '/^[[:space:]]*$/d' \
+ -e "s/'/'\\\\''/g" -e "s/^/'/g" -e "s/$/'/g" "${config}")
+ [ $# = 0 ] && return 0
einfo "Using ${config} as config:"
eindent
- local x= cnt=0 OIFS=${IFS} SIFS=${IFS-y}
- IFS=\n
- for x in ${modules} ; do
+ local x= cnt=0
+ for x in "$@" ; do
set -- ${x}
ebegin "Loading module $1"
- modprobe -q "$@" >& /dev/null
+ eval modprobe -q "$@"
eend $? "Failed to load $1" && cnt=$((${cnt} + 1))
done
- if [ "${SIFS}" = "y" ] ; then
- IFS=${save_IFS}
- else
- unset IFS
- fi
einfo "Autoloaded ${cnt} module(s)"