From 173e1f1e1052bd64c2469f0403075e5171d5986a Mon Sep 17 00:00:00 2001 From: colin Date: Tue, 20 Feb 2024 21:39:17 +0000 Subject: [PATCH] Update docker/auth-bench/run-ab.sh --- docker/auth-bench/run-ab.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/docker/auth-bench/run-ab.sh b/docker/auth-bench/run-ab.sh index a805697..bea1966 100644 --- a/docker/auth-bench/run-ab.sh +++ b/docker/auth-bench/run-ab.sh @@ -38,8 +38,14 @@ function run_apache_bench_and_check_ttfb { function upload_to_hastebin { local log_file="/logs/authenticated.csv" - local haste_url=$(curl -X POST -s -F "file=@${log_file}" https://haste.nixc.us/documents | awk -F '"' '{print "https://haste.nixc.us/"$4}') - echo "Logs uploaded to: $haste_url" + local response=$(curl -X POST -s --data-binary @"${log_file}" https://haste.nixc.us/documents) + local key=$(echo $response | awk -F '"' '{print $4}') + if [ ! -z "$key" ]; then + local haste_url="https://haste.nixc.us/$key" + echo "Logs uploaded to: $haste_url" + else + echo "Failed to upload logs to Hastebin." + fi } prepare_log_file