Skip to content
Snippets Groups Projects
Commit 002e9f74 authored by Eduardo Luis Buratti's avatar Eduardo Luis Buratti
Browse files

Merge branch 'prevent-datasid-proinfodata-conflict' of /home/git/repositories/proinfodata/unstable

parents a7680708 4e0a4b94
No related branches found
No related tags found
No related merge requests found
...@@ -112,12 +112,12 @@ if test $? -ne 0; then exit 2; fi ...@@ -112,12 +112,12 @@ if test $? -ne 0; then exit 2; fi
check_traffic_date check_traffic_date
if test $? -ne 0; then exit 3; fi if test $? -ne 0; then exit 3; fi
INPUT_COUNT=$(sudo $IPTABLES -nvxL INPUT | grep INPUT_COUNTS | \ INPUT_COUNT=$(sudo $IPTABLES -nvxL INPUT | grep PID_INPUT_COUNTS | \
awk 'BEGIN{pkts=0; bytes=0} \ awk 'BEGIN{pkts=0; bytes=0} \
{pkts+=$1; bytes+=$2} \ {pkts+=$1; bytes+=$2} \
END{print pkts,bytes}') END{print pkts,bytes}')
OUTPUT_COUNT=$(sudo $IPTABLES -nvxL OUTPUT | grep OUTPUT_COUNTS | \ OUTPUT_COUNT=$(sudo $IPTABLES -nvxL OUTPUT | grep PID_OUTPUT_COUNTS | \
awk 'BEGIN{pkts=0; bytes=0} \ awk 'BEGIN{pkts=0; bytes=0} \
{pkts+=$1; bytes+=$2} \ {pkts+=$1; bytes+=$2} \
END{print pkts,bytes}') END{print pkts,bytes}')
...@@ -132,9 +132,9 @@ echo "$INTERVALID $INPUT_COUNT $OUTPUT_COUNT" >> $TRAFFIC ...@@ -132,9 +132,9 @@ echo "$INTERVALID $INPUT_COUNT $OUTPUT_COUNT" >> $TRAFFIC
if test -f "$INTERFACES"; then if test -f "$INTERFACES"; then
while IFS=$' ' read -a net; do while IFS=$' ' read -a net; do
sudo $IPTABLES -D INPUT -i ${net[0]} ! -s ${net[1]} -m comment \ sudo $IPTABLES -D INPUT -i ${net[0]} ! -s ${net[1]} -m comment \
--comment INPUT_COUNTS 2>/dev/null --comment PID_INPUT_COUNTS 2>/dev/null
sudo $IPTABLES -D OUTPUT -o ${net[0]} ! -d ${net[1]} -m comment \ sudo $IPTABLES -D OUTPUT -o ${net[0]} ! -d ${net[1]} -m comment \
--comment OUTPUT_COUNTS 2>/dev/null --comment PID_OUTPUT_COUNTS 2>/dev/null
done < $INTERFACES done < $INTERFACES
fi fi
...@@ -153,7 +153,7 @@ done ...@@ -153,7 +153,7 @@ done
# Insert new rules # Insert new rules
while IFS=$' ' read -a net; do while IFS=$' ' read -a net; do
sudo $IPTABLES -I INPUT -i ${net[0]} ! -s ${net[1]} -m comment \ sudo $IPTABLES -I INPUT -i ${net[0]} ! -s ${net[1]} -m comment \
--comment INPUT_COUNTS --comment PID_INPUT_COUNTS
sudo $IPTABLES -I OUTPUT -o ${net[0]} ! -d ${net[1]} -m comment \ sudo $IPTABLES -I OUTPUT -o ${net[0]} ! -d ${net[1]} -m comment \
--comment OUTPUT_COUNTS --comment PID_OUTPUT_COUNTS
done < $INTERFACES done < $INTERFACES
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment