spit in a distance

This commit is contained in:
Shihaam Abdul Rahman 2023-11-27 22:30:05 +05:00
parent b98e3b6d34
commit 361b91fad2
Signed by: shihaam
GPG Key ID: 6DA2E87EBC227636

8
bot.sh
View File

@ -49,7 +49,7 @@ echo Satellite Image grabbed
################################################################################# #################################################################################
echo Doing speedtest by Ookla echo Doing speedtest by Ookla
# Run speedtest and output to a file # Run speedtest and output to a file
speedtest --json | tee$speedtest_ookla speedtest --json | tee $speedtest_ookla
# Extract information from the speedtest output # Extract information from the speedtest output
# Parsing JSON data # Parsing JSON data
@ -71,7 +71,7 @@ ookla_bytes_sent_mb=$(echo "scale=2; $ookla_bytes_sent / 1048576" | bc)
ookla_total=$(echo $ookla_bytes_sent_mb+$ookla_bytes_received_mb | bc) ookla_total=$(echo $ookla_bytes_sent_mb+$ookla_bytes_received_mb | bc)
echo Starting LibreSpeed echo Starting LibreSpeed
librespeed-cli --json | tee$speedtest_libre librespeed-cli --json | tee $speedtest_libre
# Parsing JSON data # Parsing JSON data
libre_bytes_sent=$(jq '.[0].bytes_sent' "$speedtest_libre") libre_bytes_sent=$(jq '.[0].bytes_sent' "$speedtest_libre")
@ -88,7 +88,7 @@ libre_bytes_received_mb=$(echo "scale=2; $libre_bytes_received / 1048576" | bc)
libre_total=$(echo $libre_bytes_sent_mb+$libre_bytes_received_mb | bc) libre_total=$(echo $libre_bytes_sent_mb+$libre_bytes_received_mb | bc)
echo Starting Fast echo Starting Fast
fast --upload --json | tee$speedtest_fast fast --upload --json | tee $speedtest_fast
fast_download_speed=$(jq '.downloadSpeed' "$speedtest_fast") fast_download_speed=$(jq '.downloadSpeed' "$speedtest_fast")
fast_upload_speed=$(jq '.uploadSpeed' "$speedtest_fast") fast_upload_speed=$(jq '.uploadSpeed' "$speedtest_fast")
fast_latency=$(jq '.latency' "$speedtest_fast") fast_latency=$(jq '.latency' "$speedtest_fast")
@ -113,7 +113,7 @@ googledns_ping=$(latency 8.8.8.8)
################################################################################# #################################################################################
echo Checking weather echo Checking weather
# Make the API request # Make the API request
curl -s "https://api.open-meteo.com/v1/forecast?latitude=${LATITUDE}&longitude=${LONGITUDE}&current_weather=true" | tee$weather_file curl -s "https://api.open-meteo.com/v1/forecast?latitude=${LATITUDE}&longitude=${LONGITUDE}&current_weather=true" | tee $weather_file
# Extract Weather Condition and day or not # Extract Weather Condition and day or not
weather_condition=$(jq '.current_weather.weathercode' "$weather_file") weather_condition=$(jq '.current_weather.weathercode' "$weather_file")
is_day=$(jq '.current_weather.is_day' "$weather_file") is_day=$(jq '.current_weather.is_day' "$weather_file")