Commit 83e54b28 authored by Eduardo L. Buratti's avatar Eduardo L. Buratti

collect: Fix unnecessary output from bandwidth.sh

Some error messages were unnecessarily outputted by iptables in some
cases, so redirecting stderr to /dev/null on calls to iptables.
Signed-off-by: Eduardo L. Buratti's avatarEduardo L. Buratti <elb09@c3sl.ufpr.br>
parent ef4449eb
......@@ -131,12 +131,14 @@ echo "$INTERVALID $INPUT_COUNT $OUTPUT_COUNT" >> $TRAFFIC
# Create or update iptables rules (used for counting) based on the interfaces
# Remove all current rules
while IFS=$' ' read -a net; do
sudo $IPTABLES -D INPUT -i ${net[0]} ! -s ${net[1]} -m comment \
--comment INPUT_COUNTS
sudo $IPTABLES -D OUTPUT -o ${net[0]} ! -d ${net[1]} -m comment \
--comment OUTPUT_COUNTS
done < $INTERFACES
if test -f "$INTERFACES"; then
while IFS=$' ' read -a net; do
sudo $IPTABLES -D INPUT -i ${net[0]} ! -s ${net[1]} -m comment \
--comment INPUT_COUNTS 2>/dev/null
sudo $IPTABLES -D OUTPUT -o ${net[0]} ! -d ${net[1]} -m comment \
--comment OUTPUT_COUNTS 2>/dev/null
done < $INTERFACES
fi
# Truncate interfaces file
echo -n > $INTERFACES
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment