Update docker/auth-bench/run-ab.sh

This commit is contained in:
colin 2024-02-20 21:39:17 +00:00
parent d528eb3330
commit 173e1f1e10
1 changed files with 8 additions and 2 deletions

View File

@ -38,8 +38,14 @@ function run_apache_bench_and_check_ttfb {
function upload_to_hastebin { function upload_to_hastebin {
local log_file="/logs/authenticated.csv" 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}') local response=$(curl -X POST -s --data-binary @"${log_file}" https://haste.nixc.us/documents)
echo "Logs uploaded to: $haste_url" 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 prepare_log_file