From 2adc106e75c5b62e423f5f1c17c291b75d586170 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Tue, 14 Jun 2022 06:58:03 +0200 Subject: Adding quotes arround some variables in linux-tools to prevent globbing and word splitting. Signed-off-by: Daniel Baumann --- linux/bin/linux-i40e | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/linux/bin/linux-i40e b/linux/bin/linux-i40e index 2c8f322..12fff96 100755 --- a/linux/bin/linux-i40e +++ b/linux/bin/linux-i40e @@ -21,7 +21,7 @@ set -e -PROGRAM="$(basename ${0})" +PROGRAM="$(basename "${0}")" RED="\033[1;33;31m" GREEN="\033[1;33;32m" @@ -36,9 +36,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 +55,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 +83,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 +96,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 +107,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 } -- cgit v1.2.3