From 2d32b1577c01b2b933f0168f122e2127da3ef605 Mon Sep 17 00:00:00 2001 From: Maximilian Wilhelm Date: Sun, 11 Oct 2020 03:28:23 +0200 Subject: [PATCH] bond executor: grep for options only once Signed-off-by: Maximilian Wilhelm --- executor-scripts/linux/bond | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/executor-scripts/linux/bond b/executor-scripts/linux/bond index 27d1353..bd882b3 100755 --- a/executor-scripts/linux/bond +++ b/executor-scripts/linux/bond @@ -11,12 +11,8 @@ set -e [ -n "$VERBOSE" ] && set -x get_bond_options() { - env | while IFS="=" read opt value; do - # We only care for options of format IF_BOND_ - if ! echo "${opt}" | grep -q '^IF_BOND_[A-Z0-9_]\+$'; then - continue - fi - + # We only care for options of format IF_BOND_ + env | grep '^IF_BOND_[A-Z0-9_]\+$' | while IFS="=" read opt value; do # Members are handled seperately if [ "${opt}" = "IF_BOND_MEMBERS" ]; then continue