From fadee8e656807f466cdf39a9a9c0c113613bc36d Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Wed, 2 Jan 2008 15:38:37 +0000 Subject: Move _shell_var shell function to shell_var C applet --- init.d.Linux/modules | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) (limited to 'init.d.Linux/modules') diff --git a/init.d.Linux/modules b/init.d.Linux/modules index 4a5c1257..c02510ed 100755 --- a/init.d.Linux/modules +++ b/init.d.Linux/modules @@ -30,21 +30,6 @@ depend() { use isapnp } -_shell_var() { - local rem=$1 c= r= var= - while [ -n "${rem}" ]; do - r=${rem#?} - c=${rem%${r}} - case "${c}" in - [a-zA-Z0-9]);; - *) c=_;; - esac - var=${var}${c} - rem=${r} - done - echo ${var} -} - start() { # Should not fail if kernel do not have module # support compiled in ... @@ -59,14 +44,14 @@ start() { local list= x= args= cnt=0 for x in "${KV}" ${KV_MAJOR}.${KV_MINOR}.${KV_MICRO} ${KV_MAJOR}.${KV_MINOR}; do - eval list=\$modules_$(_shell_var "${x}") + eval list=\$modules_$(shell_var "${x}") [ -n "${list}" ] && break done [ -z "${list}" ] && list=${modules} for x in ${list}; do ebegin "Loading module ${x}" - eval args=\$module_$(_shell_var "${x}")_args + eval args=\$module_$(shell_var "${x}")_args eval modprobe -q "${x}" "${args}" eend $? "Failed to load ${x}" && cnt=$((${cnt} + 1)) done -- cgit v1.2.3