From 18a1c20d26c5862c84e0b5e90b31566e8e5421a5 Mon Sep 17 00:00:00 2001 From: Rasmus Dahlberg Date: Mon, 3 Apr 2023 21:10:14 +0200 Subject: Select any relay in a given country and city --- scripts/measure.sh | 18 ++++++++++-------- 1 file 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; } -- cgit v1.2.3