aboutsummaryrefslogtreecommitdiff
path: root/sh
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-01-02 15:38:37 +0000
committerRoy Marples <roy@marples.name>2008-01-02 15:38:37 +0000
commitfadee8e656807f466cdf39a9a9c0c113613bc36d (patch)
tree1179d0acb5e063621467654263e978274ec387dd /sh
parente5933843e81b213786f78bb267f84fa78f663b61 (diff)
Move _shell_var shell function to shell_var C applet
Diffstat (limited to 'sh')
-rwxr-xr-xsh/net.sh21
1 files changed, 3 insertions, 18 deletions
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