added waste monitoring
This commit is contained in:
parent
dc232ce618
commit
e2ecf2c0f5
11
bot.sh
11
bot.sh
@ -51,6 +51,8 @@ ookla_upload_mbps=$(echo "scale=2; $ookla_upload / 1000000" | bc)
|
||||
ookla_bytes_received_mb=$(echo "scale=2; $ookla_bytes_received / 1048576" | bc)
|
||||
ookla_bytes_sent_mb=$(echo "scale=2; $ookla_bytes_sent / 1048576" | bc)
|
||||
|
||||
ookla_total=$(echo $ookla_bytes_sent_mb+$ookla_bytes_received_mb | bc)
|
||||
|
||||
echo Starting LibreSpeed
|
||||
librespeed-cli --json > $speedtest_libre
|
||||
|
||||
@ -66,6 +68,8 @@ libre_server_name=$(jq -r '.[0].server.name' "$speedtest_libre")
|
||||
libre_bytes_sent_mb=$(echo "scale=2; $libre_bytes_sent / 1048576" | bc)
|
||||
libre_bytes_received_mb=$(echo "scale=2; $libre_bytes_received / 1048576" | bc)
|
||||
|
||||
libre_total=$(echo $libre_bytes_sent_mb+$libre_bytes_received_mb | bc)
|
||||
|
||||
echo Starting Fast
|
||||
fast --upload --json > $speedtest_fast
|
||||
fast_download_speed=$(jq '.downloadSpeed' "$speedtest_fast")
|
||||
@ -74,6 +78,8 @@ fast_latency=$(jq '.latency' "$speedtest_fast")
|
||||
fast_downloaded=$(jq '.downloaded' "$speedtest_fast")
|
||||
fast_uploaded=$(jq '.uploaded' "$speedtest_fast")
|
||||
|
||||
fast_total=$(echo $fast_downloaded+$fast_uploaded | bc)
|
||||
|
||||
echo Speedtests complete
|
||||
#################################################################################
|
||||
|
||||
@ -98,6 +104,9 @@ echo Weather checked
|
||||
#################################################################################
|
||||
|
||||
#################################################################################
|
||||
|
||||
total_wasted=$(echo $ookla_total+$libre_total+$fast_total | bc)
|
||||
|
||||
caption="
|
||||
$current_weather
|
||||
|
||||
@ -117,6 +126,8 @@ $current_weather
|
||||
🏓 *Latency*: $fast_latency ms
|
||||
⬇️ *Download*: $fast_download_speed Mbit/s, Used: $fast_downloaded MB
|
||||
⬆️ *Upload*: $fast_upload_speed Mbit/s, Used: $fast_uploaded MB
|
||||
|
||||
Total data wasted: $total_wasted MB
|
||||
"
|
||||
#################################################################################
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user