Network config arrays are now split by embedded new lines instead of being evaled into space separated values. This makes it easier to read, maintain and document as discussed on gentoo-dev.

This commit is contained in:
Roy Marples
2007-10-29 09:45:49 +00:00
parent 42c231d760
commit e372729b8c
14 changed files with 260 additions and 187 deletions

View File

@@ -13,10 +13,9 @@ _is_bond() {
}
bonding_pre_start() {
local s= slaves=
local s= slaves="$(_get_array "slaves_${IFVAR}")"
eval $(_get_array "slaves_${IFVAR}")
[ $# = "0" ] && return 0
[ -z "${slaves}" ] && return 0
# Load the kernel module if required
if [ ! -d /proc/net/bonding ] ; then
@@ -40,16 +39,16 @@ bonding_pre_start() {
ebegin "Adding slaves to ${IFACE}"
eindent
einfo "$@"
einfo "${slaves}"
# Check that our slaves exist
(
for IFACE in "$@" ; do
for IFACE in ${slaves}; do
_exists true || return 1
done
# Must force the slaves to a particular state before adding them
for IFACE in "$@" ; do
for IFACE in ${slaves}; do
_delete_addresses
_up
done
@@ -60,7 +59,7 @@ bonding_pre_start() {
# finally add in slaves
eoutdent
/sbin/ifenslave "${IFACE}" $@ >/dev/null
/sbin/ifenslave "${IFACE}" ${slaves} >/dev/null
eend $?
return 0 #important