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 --- sh/net.sh | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) (limited to 'sh') diff --git a/sh/net.sh b/sh/net.sh index 34ce540b..ef701c6a 100755 --- a/sh/net.sh +++ b/sh/net.sh @@ -34,24 +34,9 @@ description="Configures network interfaces." # Handy var so we don't have to embed new lines everywhere for array splitting __IFS=" " -_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} -} - depend() { local IFACE=${SVCNAME#*.} - local IFVAR=$(_shell_var "${IFACE}") + local IFVAR=$(shell_var "${IFACE}") need localmount after bootmisc @@ -454,7 +439,7 @@ _load_config() { start() { local IFACE=${SVCNAME#*.} oneworked=false module= - local IFVAR=$(_shell_var "${IFACE}") cmd= our_metric= + local IFVAR=$(shell_var "${IFACE}") cmd= our_metric= local metric=0 einfo "Bringing up interface ${IFACE}" @@ -629,7 +614,7 @@ ${routes}" stop() { local IFACE=${SVCNAME#*.} module= - local IFVAR=$(_shell_var "${IFACE}") opts= + local IFVAR=$(shell_var "${IFACE}") opts= einfo "Bringing down interface ${IFACE}" eindent -- cgit v1.2.3