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