Created
February 17, 2022 03:43
-
-
Save masterbpro/0c9f88fc158043d8455f3a42f3d9cc14 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
case "$1" in | |
100) URL="http://ftp.corbina.ru/pub/100Mb" | |
FILE_SIZE="10485760" | |
;; | |
10) URL="http://ftp.corbina.ru/pub/10Mb" | |
FILE_SIZE="10485760" | |
;; | |
*) URL="http://ftp.corbina.ru/pub/10Mb" | |
FILE_SIZE="10485760" | |
;; | |
esac | |
BEFORE_TIME=`date +%s` | |
wget -O /dev/null $URL | |
AFTER_TIME=`date +%s` | |
TOTAL_TIME=$(($AFTER_TIME - $BEFORE_TIME)) | |
MB_FILE_SIZE=$((($FILE_SIZE / 1048576) / $TOTAL_TIME)) | |
kB_FILE_SIZE=$((($FILE_SIZE / 1024) / $TOTAL_TIME)) | |
Mb_FILE_SIZE=$(((($FILE_SIZE / 1048576) * 8) / $TOTAL_TIME)) | |
echo "Average download Speeds:" | |
echo "$MB_FILE_SIZE MB/s" | |
echo "$kB_FILE_SIZE kB/s" | |
echo "$Mb_FILE_SIZE Mb/s" |
Author
masterbpro
commented
Feb 17, 2022
•
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment