[fix] Add verbose flag so that so-monitor-add only sees necessary information

This commit is contained in:
William Wernert
2021-01-15 09:25:04 -05:00
parent f4de5e28bf
commit ed129bcf1f
2 changed files with 19 additions and 4 deletions

View File

@@ -41,8 +41,18 @@ add_interface_bond0() {
fi
done
case "$2" in
-v|--verbose)
local verbose=true
;;
esac
for i in rx tx sg tso ufo gso gro lro; do
if [[ $verbose != true ]]; then
ethtool -K "$BNIC" $i off
else
ethtool -K "$BNIC" $i off &>/dev/null
fi
done
# Check if the bond slave connection has already been created
nmcli -f name,uuid -p con | grep -q "bond0-slave-$BNIC"
@@ -64,7 +74,12 @@ add_interface_bond0() {
ip link set dev "$BNIC" arp off multicast off allmulticast off promisc on
nmcli con up "bond0-slave-$BNIC" # Bring the slave interface up
# Bring the slave interface up
if [[ $verbose != true ]]; then
nmcli con up "bond0-slave-$BNIC"
else
nmcli con up "bond0-slave-$BNIC" &>/dev/null
fi
if [ "$nic_error" != 0 ]; then
return "$nic_error"

View File

@@ -884,7 +884,7 @@ configure_network_sensor() {
local err=0
for BNIC in "${BNICS[@]}"; do
add_interface_bond0 "$BNIC" >> "$setup_log" 2>&1
add_interface_bond0 "$BNIC" --verbose >> "$setup_log" 2>&1
local ret=$?
[[ $ret -eq 0 ]] || err=$ret
done