summaryrefslogtreecommitdiff
path: root/sh
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2007-11-29 11:17:50 +0000
committerRoy Marples <roy@marples.name>2007-11-29 11:17:50 +0000
commit50161bef0e27ca235d876b888ae5abcafbec2ac7 (patch)
treea765b218d2e7ec7f9435411dbf0ec0fbe582ecda /sh
parentf0aa06b58626626729f8d7af6f6a9edf08c807f4 (diff)
downloadopenrc-50161bef0e27ca235d876b888ae5abcafbec2ac7.tar.gz
openrc-50161bef0e27ca235d876b888ae5abcafbec2ac7.tar.bz2
openrc-50161bef0e27ca235d876b888ae5abcafbec2ac7.tar.xz
Allow space separated configs to work for CIDR address styles
Diffstat (limited to 'sh')
-rwxr-xr-xsh/net.sh20
1 files changed, 18 insertions, 2 deletions
diff --git a/sh/net.sh b/sh/net.sh
index f5535b8..992eacf 100755
--- a/sh/net.sh
+++ b/sh/net.sh
@@ -410,11 +410,27 @@ ${config}"
fi
fi
+ config_index=0
+ local IFS="$__IFS"
+ set -- ${config}
+
+ # We should support a space separated array for cidr configs
+ if [ $# = 1 ]; then
+ unset IFS
+ set -- ${config}
+ # Of course, we may have a single address added old style.
+ case "$2" in
+ netmask|broadcast|brd|brd+)
+ local IFS="$__IFS"
+ set -- ${config}
+ ;;
+ esac
+ fi
+
# We store our config in an array like vars
# so modules can influence it
config_index=0
- local IFS="$__IFS"
- for cmd in ${config}; do
+ for cmd; do
eval config_${config_index}="'${cmd}'"
config_index=$((${config_index} + 1))
done