aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRasmus Dahlberg <rasmus@rgdd.se>2023-04-03 21:10:14 +0200
committerRasmus Dahlberg <rasmus@rgdd.se>2023-04-03 21:25:26 +0200
commit18a1c20d26c5862c84e0b5e90b31566e8e5421a5 (patch)
tree2a3be3a6a04aceafc5b98dff53814c4852ed0a9e
parentb30c794ce8a49b89cf77057719a71bbe9cd54c8d (diff)
Select any relay in a given country and city
-rwxr-xr-xscripts/measure.sh18
1 files changed, 10 insertions, 8 deletions
diff --git a/scripts/measure.sh b/scripts/measure.sh
index ee05442..db1ec5c 100755
--- a/scripts/measure.sh
+++ b/scripts/measure.sh
@@ -8,7 +8,8 @@
# lists 8.8.8.8 and 8.8.4.4, output of uname -a and sysctl -a is ..., etc.
#
-relay=se-sto-wg-001
+relay_country=se
+relay_city=sto
limit=1450
num_workers=10000
input_file=/path/to/input/file
@@ -22,7 +23,8 @@ mullvad_wait_s=5
set -eu
function main() {
num_sites=$(wc -l $input_file | cut -d' ' -f1)
- debug "relay=$relay"
+ debug "relay_country=$relay_country"
+ debug "relay_city=$relay_city"
debug "limit=${limit}"
debug "num_workers=$num_workers"
debug "input_file=$input_file ($num_sites sites)"
@@ -32,8 +34,8 @@ function main() {
debug "mullvad_wait_s=$mullvad_wait_s"
mkdir -p "$out_dir"
- stdout_file=$out_dir/$relay-l$limit.stdout
- stderr_file=$out_dir/$relay-l$limit.stderr
+ stdout_file=$out_dir/$relay_country-$relay_city-l$limit.stdout
+ stderr_file=$out_dir/$relay_country-$relay_city-l$limit.stderr
info "storing results in $out_dir"
now=$(date +%s)
@@ -43,12 +45,12 @@ function main() {
debug "estimated done? approximately $(date -d @$estimated_done +"%Y-%m-%d %H:%M:%S %Z")"
mullvad disconnect >/dev/null
- mullvad relay set hostname $relay >/dev/null
+ mullvad relay set location $relay_country $relay_city >/dev/null
mullvad connect >/dev/null
sleep $mullvad_wait_s
ip=$(curl -s https://ifconfig.me)
- info "starting measurement from relay $relay ($ip)"
+ info "starting measurement from relay with ip $ip"
debug "view progress with \"tail -f $stderr_file\""
onion-grab\
@@ -63,8 +65,8 @@ function main() {
./digest.py\
-v info\
-i "$stdout_file"\
- -o "$out_dir/$relay-l$limit-onion-all.txt"\
- -d "$out_dir/$relay-l$limit-domain-all.txt"
+ -o "$out_dir/$relay_country-$relay_city-l$limit-onion-all.txt"\
+ -d "$out_dir/$relay_country-$relay_city-l$limit-domain-all.txt"
}
function debug() { echo "$(date +"%Y-%m-%d %H:%M:%S %Z") [DEBU] $@" >&2; }