diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2022-06-14 12:00:25 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2022-06-14 12:00:35 +0000 |
commit | e679b4ca18df1f17fb177b49f0426fb8f70c2a9f (patch) | |
tree | 4eedbd86766af04c1ea50521516364adac62bbf4 /linux/bin | |
parent | Releasing debian version 20220609-1. (diff) | |
download | open-infrastructure-service-tools-e679b4ca18df1f17fb177b49f0426fb8f70c2a9f.tar.xz open-infrastructure-service-tools-e679b4ca18df1f17fb177b49f0426fb8f70c2a9f.zip |
Merging upstream version 20220614.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'linux/bin')
-rwxr-xr-x | linux/bin/linux-i40e | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/linux/bin/linux-i40e b/linux/bin/linux-i40e index 2c8f322..ffe17b3 100755 --- a/linux/bin/linux-i40e +++ b/linux/bin/linux-i40e @@ -21,13 +21,10 @@ set -e -PROGRAM="$(basename ${0})" +PROGRAM="$(basename "${0}")" RED="\033[1;33;31m" GREEN="\033[1;33;32m" -YELLOW="\033[1;33;33m" -BLUE="\033[1;33;34m" -WHITE="\033[1;33;37m" NORMAL="\033[0m" Ethtool_get () @@ -36,9 +33,9 @@ Ethtool_get () FLAG="${2}" TARGET_VALUE="${3}" - if ethtool --show-priv-flags ${DEVICE} | awk '{ print $1 }' | grep -qs "^${FLAG}$" + if ethtool --show-priv-flags "${DEVICE}" | awk '{ print $1 }' | grep -qs "^${FLAG}$" then - CURRENT_VALUE="$(ethtool --show-priv-flags ${DEVICE} | awk "/^${FLAG} / { print \$3 }")" + CURRENT_VALUE="$(ethtool --show-priv-flags "${DEVICE}" | awk "/^${FLAG} / { print \$3 }")" if [ "${CURRENT_VALUE}" = "${TARGET_VALUE}" ] then @@ -55,10 +52,10 @@ Ethtool_set () FLAG="${2}" VALUE="${3}" - if ethtool --show-priv-flags ${DEVICE} | awk '{ print $1 }' | grep -qs "^${FLAG}$" + if ethtool --show-priv-flags "${DEVICE}" | awk '{ print $1 }' | grep -qs "^${FLAG}$" then echo -n " ${FLAG}" - ethtool --set-priv-flags ${DEVICE} ${FLAG} ${VALUE} + ethtool --set-priv-flags "${DEVICE}" "${FLAG}" "${VALUE}" echo -n "=${VALUE}" fi } @@ -83,8 +80,8 @@ Start () for DEVICE in ${DEVICES} do echo -n "Configuring ${DEVICE}:" - Ethtool_set ${DEVICE} disable-fw-lldp on - Ethtool_set ${DEVICE} link-down-on-close on + Ethtool_set "${DEVICE}" disable-fw-lldp on + Ethtool_set "${DEVICE}" link-down-on-close on echo done } @@ -96,8 +93,8 @@ Stop () for DEVICE in ${DEVICES} do echo -n "Deconfiguring ${DEVICE}:" - Ethtool_set ${DEVICE} disable-fw-lldp off - Ethtool_set ${DEVICE} link-down-on-close off + Ethtool_set "${DEVICE}" disable-fw-lldp off + Ethtool_set "${DEVICE}" link-down-on-close off echo done } @@ -107,8 +104,8 @@ Status () for DEVICE in ${DEVICES} do echo -n "${DEVICE}:" - Ethtool_get ${DEVICE} disable-fw-lldp on - Ethtool_get ${DEVICE} link-down-on-close on + Ethtool_get "${DEVICE}" disable-fw-lldp on + Ethtool_get "${DEVICE}" link-down-on-close on echo done } |