adding ntfy
This commit is contained in:
parent
4cc9f633b5
commit
73ebf15822
|
@ -37,18 +37,22 @@ function run_apache_bench_and_check_ttfb {
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
function upload_to_hastebin {
|
function upload_to_hastebin_and_notify {
|
||||||
local log_file="/logs/authenticated.csv"
|
local log_file="/logs/authenticated.csv"
|
||||||
local response=$(curl -X POST -s --data-binary @"${log_file}" https://haste.nixc.us/documents)
|
local response=$(curl -X POST -s --data-binary @"${log_file}" https://haste.nixc.us/documents)
|
||||||
local key=$(echo $response | awk -F '"' '{print $4}')
|
local key=$(echo $response | awk -F '"' '{print $4}')
|
||||||
|
|
||||||
if [ ! -z "$key" ]; then
|
if [ ! -z "$key" ]; then
|
||||||
local haste_url="https://haste.nixc.us/$key"
|
local haste_url="https://haste.nixc.us/$key"
|
||||||
echo "Logs uploaded to: $haste_url"
|
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
|
else
|
||||||
echo "Failed to upload logs to Hastebin."
|
echo "Failed to upload logs to Hastebin."
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
prepare_log_file
|
prepare_log_file
|
||||||
run_apache_bench_and_check_ttfb
|
run_apache_bench_and_check_ttfb
|
||||||
upload_to_hastebin
|
upload_to_hastebin
|
||||||
|
|
Loading…
Reference in New Issue