diff --git a/bot.sh b/bot.sh index 3b5d70a..6430971 100755 --- a/bot.sh +++ b/bot.sh @@ -119,6 +119,8 @@ fast_total=$(echo $fast_downloaded+$fast_uploaded | bc) average_download=$(echo $ookla_download_mbps+$libre_download+$fast_download_speed/3 | bc) average_upload=$(echo $ookla_upload_mbps+$libre_upload+$fast_upload_speed/3| bc) +highest_download=$(echo $ookla_download_mbps $libre_download $fast_download_speed | tr ' ' '\n' | sort -nr | head -n1) +highest_upload=$(echo $ookla_upload_mbps $libre_upload $fast_upload_speed | tr ' ' '\n' | sort -nr | head -n1) total_wasted=$(echo $ookla_total+$libre_total+$fast_total | bc) echo Speedtests complete @@ -176,8 +178,8 @@ echo Weather checked ################################################################################# -download_angle=$(echo "scale=2; -118 + ($average_download - 0) / ($MAX_DOWNLOAD_SPEED - 0) * (118 - -118)" | bc) -upload_angle=$(echo "scale=2; -118 + ($average_upload - 0) / ($MAX_UPLOAD_SPEED - 0) * (118 - -118)" | bc) +download_angle=$(echo "scale=2; -118 + ($highest_download - 0) / ($MAX_DOWNLOAD_SPEED - 0) * (118 - -118)" | bc) +upload_angle=$(echo "scale=2; -118 + ($highest_upload - 0) / ($MAX_UPLOAD_SPEED - 0) * (118 - -118)" | bc) convert $download_meter \ \( $needle -background none \ @@ -188,7 +190,7 @@ convert $download_meter \ -pointsize 41 \ -font $font \ -fill white \ - -annotate +0+-15 $average_download \ + -annotate +0+-15 $highest_download \ -annotate +120+85 $MAX_DOWNLOAD_SPEED \ $speedtest_download_meter @@ -201,7 +203,7 @@ convert $upload_meter \ -pointsize 41 \ -font $font \ -fill white \ - -annotate +0+-15 $average_upload \ + -annotate +0+-15 $highest_upload \ -annotate +120+85 $MAX_UPLOAD_SPEED \ $speedtest_upload_meter