bond executor: grep for options only once

Signed-off-by: Maximilian Wilhelm <max@sdn.clinic>
This commit is contained in:
Maximilian Wilhelm 2020-10-11 03:28:23 +02:00
parent 953b2274f7
commit 2d32b1577c

View file

@ -11,12 +11,8 @@ set -e
[ -n "$VERBOSE" ] && set -x [ -n "$VERBOSE" ] && set -x
get_bond_options() { get_bond_options() {
env | while IFS="=" read opt value; do # We only care for options of format IF_BOND_<OPTION_NAME>
# We only care for options of format IF_BOND_<OPTION_NAME> env | grep '^IF_BOND_[A-Z0-9_]\+$' | while IFS="=" read opt value; do
if ! echo "${opt}" | grep -q '^IF_BOND_[A-Z0-9_]\+$'; then
continue
fi
# Members are handled seperately # Members are handled seperately
if [ "${opt}" = "IF_BOND_MEMBERS" ]; then if [ "${opt}" = "IF_BOND_MEMBERS" ]; then
continue continue