diff --git a/docker/auth-bench/run-ab.sh b/docker/auth-bench/run-ab.sh index 400422b..1f7b5d3 100644 --- a/docker/auth-bench/run-ab.sh +++ b/docker/auth-bench/run-ab.sh @@ -37,18 +37,22 @@ function run_apache_bench_and_check_ttfb { done } -function upload_to_hastebin { +function upload_to_hastebin_and_notify { local log_file="/logs/authenticated.csv" 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" + # Send notification with the Haste URL, including the authentication token + curl -X POST -H "Authorization: Bearer tk_xjkgklandq47adj1f17bw6edtilh4" -d "$haste_url" https://ntfy.nixc.us/bnHobG80sO5ZF4SB else echo "Failed to upload logs to Hastebin." fi } + prepare_log_file run_apache_bench_and_check_ttfb upload_to_hastebin