From 86f9ce943e2c2c70a70af417d74506c9d8f5f1db Mon Sep 17 00:00:00 2001 From: Matija Sirk Date: Thu, 4 Aug 2016 08:59:00 +0200 Subject: [PATCH] Update updateproxy.sh --- updateproxy.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/updateproxy.sh b/updateproxy.sh index 26e853a..2f164f6 100644 --- a/updateproxy.sh +++ b/updateproxy.sh @@ -1,23 +1,23 @@ #!/bin/bash #Change proxy every DELAY seconds for MAX times -FILE=./toriptables2.py +FILE=toriptables2.py COUNTER=0 -MAX=$1 +MAX=$1 # DELAY=$2 -#Check if arg was received -if [ -z "$2" ]; then +#Check if args was received +if [ $# -ne 2 ]; then echo "USAGE: sudo ${0} " exit fi #iptables dropping packets makes sure your real ip isn't leaked if webpage #is being fetched during the proxy reload. -while [ $COUNTER -lt $MAX ]; do +while [ ${COUNTER} -lt ${MAX} ]; do iptables -w -P OUTPUT DROP - python $FILE -l + ${FILE} -l iptables -w -P OUTPUT ACCEPT - sleep $DELAY - let COUNTER=COUNTER+1 + sleep ${DELAY} + let "COUNTER += 1" done