Update updateproxy.sh

This commit is contained in:
Matija Sirk 2016-08-04 08:59:00 +02:00 committed by GitHub
parent 5749a88bcf
commit 86f9ce943e

View file

@ -1,23 +1,23 @@
#!/bin/bash #!/bin/bash
#Change proxy every DELAY seconds for MAX times #Change proxy every DELAY seconds for MAX times
FILE=./toriptables2.py FILE=toriptables2.py
COUNTER=0 COUNTER=0
MAX=$1 MAX=$1 #
DELAY=$2 DELAY=$2
#Check if arg was received #Check if args was received
if [ -z "$2" ]; then if [ $# -ne 2 ]; then
echo "USAGE: sudo ${0} <number-of-repetitions> <delay-between-repetitions>" echo "USAGE: sudo ${0} <number-of-repetitions> <delay-between-repetitions>"
exit exit
fi fi
#iptables dropping packets makes sure your real ip isn't leaked if webpage #iptables dropping packets makes sure your real ip isn't leaked if webpage
#is being fetched during the proxy reload. #is being fetched during the proxy reload.
while [ $COUNTER -lt $MAX ]; do while [ ${COUNTER} -lt ${MAX} ]; do
iptables -w -P OUTPUT DROP iptables -w -P OUTPUT DROP
python $FILE -l ${FILE} -l
iptables -w -P OUTPUT ACCEPT iptables -w -P OUTPUT ACCEPT
sleep $DELAY sleep ${DELAY}
let COUNTER=COUNTER+1 let "COUNTER += 1"
done done